Monday, April 4, 2011

Where can I find the Microsoft.IdentityModel DLL?

If you use any code analysis tools such as FxCop for any of your Windows Identity Foundation assemblies, you may encounter an error message such as the following:

Project : error : CA0001 : The following error was encountered while reading module 'UserClaims': Assembly reference not resolved: Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
Project : error : CA0058 : The referenced assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be found. This assembly is required for analysis and was referenced by: '.dll'.

Since it is not readily obvious as to where this assembly is located, you must look for it in the location where you have installed the Windows Identity Foundation SDK. This will usually be in one of the following locations:

1. C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\Microsoft.IdentityModel.dll
2. C:\Program Files (x86)\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\Microsoft.IdentityModel.dll

Once you create the appropriate directory/assembly reference for FxCop, this should resolve the error message and you should be able to continue performing your code analysis!

No comments:

Post a Comment