The Microsoft.Xrm.Tooling.Connector 9.0.2.12 nuget package says that it requires Microsoft.IdentityModel.Clients.ActiveDirectory >= 2.22.302111727 but when I use Microsoft.Azure.Services.AppAuthentication which requires >= 3.14.2 I get errors saying "failed: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.22.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
If I use version 2.22.0.0 the issue is resolved but I can no longer use AppAuthentication.
I know that version <= 9.0.2.7 say Microsoft.IdentityModel.Clients.ActiveDirectory (>= 2.22.302111727 && < 3.0.0) but any version >= 9.0.2.11 just say Microsoft.IdentityModel.Clients.ActiveDirectory (>= 2.22.302111727). I really don't want to separate my azure function into 2 functions just to get around this when it should be working. Any ideas on how to get this working or how to report this to the proper people?
*This post is locked for comments
Hey there,
Sometimes ugly issues require ugly solutions. What worked for me was to edit the .csproj file directly. You need to set the 2.22.x version for the ActiveDirectory package manually and also override the default warnings for detected package downgrades.
It should look something like this (where NU1605 is the warning id for package downgrades):
net462 v1 NU1605
With this in place, everything should work as expected.
Unfortunately this is still an issue, MS does not seem to get their dependency versions right.
my suggestion: separate if you can. the dependency on Microsoft.IdentityModel.Clients.ActiveDirectory is a tricky one for the Xrm part (personally I still use 2.29)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156