web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Where and how to insta...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 22

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?

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on at

    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

     

  • Yohannes Profile Picture
    22 on at

    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..

  • v-micsh-msft Profile Picture
    on at

    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

  • Cameron Profile Picture
    Microsoft Employee on at
    Yohannes, please try your scenario again - I believe this issue has been resolved. Thanks, -Cameron
  • Yohannes Profile Picture
    22 on at

    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.

  • Cameron Profile Picture
    Microsoft Employee on at
    could you perhaps provide a fiddler trace of this? It might help me determine what's going on here... Thanks, -Cameron
  • Verified answer
    Yohannes Profile Picture
    22 on at

    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.

  • Cameron Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard