0
votes

We are using azure local storage for processing temporary files. These temporary files would be uploaded to the local storage through application. For that I have configured the following code in ServiceDefinition.csdef file.

local resources LocalStorage name="ELearningSpace" sizeInMB="2000" cleanOnRoleRecycle="true" Local resources

We have used the following code to access the local storage of azure instance LocalResource uploadFolder = RoleEnvironment.GetLocalResource("mylocalStore"); file.SaveAs(uploadFolder.RootPath + "Content/" + collection["packageType"].ToString() + "/" + fileName); Also included the dll(made the dll copy local true)

  • Microsoft.identity.model.
  • Microsoft.Windowsazure.serviceruntime.

Problem: In my local machine with cloud stimulator the above mentioned code is working fine. But in the actual cloud environment I am getting an error. Exception: "The type initializer for '' threw an exception." "System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Source: mscorlib ?

Some one please help me to find where i am going wrong.

1

1 Answers

2
votes

There are scenarios where Copy Local=true isn't sufficient (link). Try installing the WIF Runtime instead using the Azure Plugin Library or the Windows Azure Bootstrapper. Installing the runtime will also copy the assemblies to the GAC and this should solve your issue.