Microsoft Dynamics CRM 2011

Microsoft Dynamics CRM 2011

Tuesday, November 11, 2014

"Could not load file or assembly Microsoft.IdentityModel" exception in Dynamics CRM 2013 (2011)


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


  1. Dynamics CRM 2011 - 2013 uses the Windows Identity Foundation in order to contact the Organization Web Service. 
  2. The "Could not load file or assembly 'Microsoft.IdentityModel" Exception's message tells us explicitly of the need of reference and loading an "assembly".
  3. 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 : .
  4. First browse to the Microsoft Identity Foundation download web page  :

    "Could not load file or assembly Microsoft.IdentityModel" exception
  5. Check that your machine complains with the Microsoft Identity Foundation 's System Requirements.
  6. Check the "Install Instructions" to see which package is appropriate for your machine :
    "Could not load file or assembly Microsoft.IdentityModel" exception 1
    And download the one you need (the 64 bit package, for instance):

  7. "Could not load file or assembly Microsoft.IdentityModel" exception 2
  8. Locate the downloaded package and open it:

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









  10. 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?
  11. 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.
  12. 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 .
  13. That's all...Enjoy Dynamics CRM

    by Carmel Schvartzman

    כתב: כרמל שוורצמן


No comments:

Post a Comment