I was trying to run a .NET application that consumes CRM 2011 WCF Services and i was getting this exception:
Could not load file or assembly 'Microsoft.IdentityModel, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
The cause of this issue is to due to missing dlls in your machine for Microsoft Identity framework that is required to have to run your application.
Install Microsoft Identity Framework in your computer that is compatible with your operating system.
For Windows 7 & Windows 2008 R2 you need to install Version 6.1
After you install this update re-run your application and will run with no exceptions!
Note: Make sure to stop your development web sever before rerun your application to reload all required assemblies.
Hope this helps!