"Could not load file or assembly Microsoft.IdentityModel" exception in Dynamics CRM 2013 (2011)
- In this walkthrough we will learn how to take care of the "Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies" error in a Dynamics CRM 2013 (2011) related .Net application .

The "Could not load file or assembly Microsoft.IdentityModel" exception
- Dynamics CRM 2011 - 2013 uses the Windows Identity Foundation in order to contact the Organization Web Service.
- The "Could not load file or assembly 'Microsoft.IdentityModel" Exception's message tells us explicitly of the need of reference and loading an "assembly".
- However, the error message is misleading, since you wont have to reference certain assembly from your .Net project. Instead, you'll need to install a Windows's update : .
- First browse to the Microsoft Identity Foundation download web page :

- Check that your machine complains with the Microsoft Identity Foundation 's System Requirements.
- Check the "Install Instructions" to see which package is appropriate for your machine :

And download the one you need (the 64 bit package, for instance):

- Locate the downloaded package and open it:

- Then follow the install steps until you finish the setup (notice that this is an update for Windows, the update KB974405):




- After you finish the installation, you will be tempted to follow the leads from the Exception message , "Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies" , by adding some assembly to your project:

But, where is the assembly?
- Remember, this is an update for Windows , and not an assembly: the error message can mislead us ...
You don't have to search some assembly, neither close-open your Visual Studio nor restart your machine. Actually, you don't have to do anything: just run again your .Net application, and you'll find that now is working perfectly.
- In this walk-through we've review how to fix the "Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies" error in a Dynamics CRM 2013 (2011) related .Net application .
- That's all...Enjoy Dynamics CRM
by Carmel Schvartzman
No comments:
Post a Comment