Unable to find assembly 'Microsoft.IdentityModel" error on azure

.net, asp.net-mvc-3, azure

Solution

More info on this. Copy Local, ie. ensuring that Microsoft.IdentityModel.dll is in the bin directory, will work unless your code uses the RoleEnvironment API. If this is the case then you will run into the following known issue:

http://msdn.microsoft.com/en-us/library/windowsazure/hh403974.aspx

In this case, Microsoft.IdentityModel will need to exist in the GAC of your Azure VM. To accomplish this, use a startup task. This post describes two ways to accomplish this:

http://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/

Problem

I am using ACS authentication for my MVC3 web application.It is working perfectly fine on my local machine.But when I upload this to Azure.I am getting this error . I set CopyLocal=True ,please help ``` Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. ```

Original source