Reputation: 235
After publishing the cloud based application (web role) from visual studio, application gives following error on accessing the landing page.
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Locally the same application works fine. I have kept the reference of Microsoft.WindowsAzure.ServiceRuntime Copy Local attribute to True in its property while publishing the site.
I am using AzureSDK 2.0 and have reference of all storage services of version 2.0 in the reference folder.
I also have following in my web.config file.
Still am getting the above error. Please suggest how to solve the issue.
Upvotes: 5
Views: 2958
Reputation: 12174
Expand the references section in Visual Studio and mark all the Azure DLLs as Copy Local = "True" - the Azure SDK DLLs need to be included in the bin directory they are not GACed.
If that fails, add an assembly binding redirect to the web.config...
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime"
publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
Upvotes: 3