I am trying to connect on premises Dynamic CRM 2016 from asp.net Web Project. I am using CrmServiceClient method with Active Directory Authentication Mode.
I am getting following exception.
{"Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.":"Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior"}
new CrmServiceClient(
new System.Net.NetworkCredential("adminuser", "pass", "domain"),
Microsoft.Xrm.Tooling.Connector.AuthenticationType.AD,
"http://sample.com", "4466", "DEV", useUniqueInstance:false,
useSsl:false)
Also Tried this
new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM_CONN"].ConnectionString)
Edited, i found the solution.
I had to downgrade: Microsoft.IdentityModel.Clients.ActiveDirectory to version 2.27 to get this working. The newer versions i tested had the same error.
Hope this works for you also!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With