cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yohannes
Level: Powered On

Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

I receive the following when creating an app with on premise SQL Server connection.

Unknown Mashup Exception.
     inner exception: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.1.741, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Where and how should I install the assembly?

1 ACCEPTED SOLUTION

Accepted Solutions
Yohannes
Level: Powered On

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Hi Cameron,

 

Funny, it's now working..! Smiley Happy

I don't know what you did on your end, but here's what I did:

 

  1. I removed the 32 bit ADAL ver. 2.28.1 from gac (ADAL that I got using nuget CLI).
  2. I added the latest version (3.13.8) of ADAL into gac. I obtained the DLL files by compiling a dummy program that references ADAL, using Visual Studio. Please note that previously this approach kept failing because PowerApps kept looking for a 2.28.1 version.
  3. I ran PowerApps again and this time it could read the database and display its tables. Hurrah..!! Man Happy
  4. I removed my ADAL 'registration' from gac (reverting from #2 above), and PowerApps still works!

I also found out that there's already an ADAL's DLL in the On Premise Gateway folder. It's version is 2.28.3 .

But it seemed to be ignored by PowerApps, before. Or maybe it's the Gateway program that ignored it. I can only guess this, because of the error message and everything that happened.

 

So here's my recommendation to those who may experience the same thing:

  1. Using gacutil.exe on the computer that has On Premise Gateway installed, add Microsoft.IdentityModel.Clients.ActiveDirectory.dll into GAC (global cache assembly).
    The DLL is located in the Gateway installation folder.
  2. Test whether this solves the problem. It's a bit different from what I did exactly, but I believe it will work just the same. Otherwise, you can still follow my footsteps. Smiley Wink
  3. If successful, you may remove Microsoft.IdentityModel.Clients.ActiveDirectory from the computer's GAC. But if this makes the problem arising again, simply add it back into the GAC and keep it listed there.

Thank you very much for your help.

View solution in original post

8 REPLIES 8
Community Support Team
Community Support Team

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Hi Yohannes,

 

I think the issue here should be related with the  on premise data gateway connection.

Could you please share more detailsabout the on premise SQL Server connection, are there any errors popped out when add this connection?

In addition, this exception occurred with PowerApp Studio, or PowerApp studio for Web?

Please follow the Troubleshooting part to check the gateway logs first:

Understand op-premises data gateways for Microsoft PowerApps

See if we could get any helpful information from there.

Also if you are using PowerApp studio, then please uninstall it and then reinstall it from Windows Store to check this issue again.

Further, in PowerApp, under Account->Diagnostics->Debug, you could be able to find the App logs, please check to see if any errors logged there.

 

Besides, Microsoft.IdentityModel.Clients.ActiveDirectory is  Active Directory Authentication Library (ADAL), which provides a Portable Class Library with easy to use authentication functionality for your .NET client on various platforms including Windows desktop, Windows Store, Xamarin iOS and Xamarin Android by taking advantage of Windows Server Active Directory and Azure Active Directory. This Library could be installed through the Package Manager Console in Visual Studio, for more information, please see:

Active Directory Authentication Library

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yohannes
Level: Powered On

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Thanks for responding.

 

I've checked other logs (in Event Log, Gatway*.log files, and so on. I only receive the one error message I posted earlier.

The exception occurs either using the web version or the desktop one.

 

I can't get PowerApps studio to recognize ADAL. If I installed it from Visual Studio, it's only accessible from within the current opened project in Visual Studio.

I've tried to put the .DLL files into .NET's gac but it didn't work; PowerApps studio reported that I'm using a wrong version of ADAL. I can only compile the latest version of ADAL, i.e. version 3.* to put in gac, but it seems that PowerApps was looking specifically for version 2.28.1.741 as it says in the error message. Visual Studio can't help me to compile the 2.28.* version.

 

PowerApps is working fine if I use it to access an SQL Server on Office 365 (cloud based). I also can create the gateway connection to our on-premise SQL Server. The exception occurs when I try to list the tables from our on-premise database as part of creating a new app.

 

Do you have more suggestions that might help? Thanks in advance..

Community Support Team
Community Support Team

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Hi Yohannes,

 

Currently not. I will try to involve someone to take a further look into this issue.

There might be some time delay.

Appreciate your patience and understanding.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Microsoft Cameron
Microsoft

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Yohannes, please try your scenario again - I believe this issue has been resolved. Thanks, -Cameron
Yohannes
Level: Powered On

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Thanks. But it's still not working.

I still receive the same message when I try to expand the database to reveal its underlying tables.

I include a snapshot here to make it clearer.

More tests below the picture ..

erro1r.png

After this, I tried to do a nuget install package to get ADAL from nuget repository. The .dll was downloaded, but it's a 32-bit dll.

And PowerApps still fails to recognize its existence, even when it's added to gac.

 

Please help.

Microsoft Cameron
Microsoft

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

could you perhaps provide a fiddler trace of this? It might help me determine what's going on here... Thanks, -Cameron
Yohannes
Level: Powered On

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

Hi Cameron,

 

Funny, it's now working..! Smiley Happy

I don't know what you did on your end, but here's what I did:

 

  1. I removed the 32 bit ADAL ver. 2.28.1 from gac (ADAL that I got using nuget CLI).
  2. I added the latest version (3.13.8) of ADAL into gac. I obtained the DLL files by compiling a dummy program that references ADAL, using Visual Studio. Please note that previously this approach kept failing because PowerApps kept looking for a 2.28.1 version.
  3. I ran PowerApps again and this time it could read the database and display its tables. Hurrah..!! Man Happy
  4. I removed my ADAL 'registration' from gac (reverting from #2 above), and PowerApps still works!

I also found out that there's already an ADAL's DLL in the On Premise Gateway folder. It's version is 2.28.3 .

But it seemed to be ignored by PowerApps, before. Or maybe it's the Gateway program that ignored it. I can only guess this, because of the error message and everything that happened.

 

So here's my recommendation to those who may experience the same thing:

  1. Using gacutil.exe on the computer that has On Premise Gateway installed, add Microsoft.IdentityModel.Clients.ActiveDirectory.dll into GAC (global cache assembly).
    The DLL is located in the Gateway installation folder.
  2. Test whether this solves the problem. It's a bit different from what I did exactly, but I believe it will work just the same. Otherwise, you can still follow my footsteps. Smiley Wink
  3. If successful, you may remove Microsoft.IdentityModel.Clients.ActiveDirectory from the computer's GAC. But if this makes the problem arising again, simply add it back into the GAC and keep it listed there.

Thank you very much for your help.

View solution in original post

Microsoft Cameron
Microsoft

Re: Where and how to install Microsoft.IdentityModel.Clients.ActiveDirectory assembly

How very curious... I'm glad this worked for you, and hopefully if others using the gateway run into this problem, perhaps this will be helpful.

 

Thanks!

-Cameron

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,363)