Question

We are using Azure SDK 1.8 and it working fine on local. we are using TFS hosted build controller to deploy on azure.

It was working fine before but sudden today we getting this error although we have no azure sdk dll version changed but online we get this error. Is this because of TFS build controller upgraded with new sdk? and strange thing this build is showing successful every time.

In TFS build service I found this strange stuff why it is referencing to v2.0 sdk. enter image description here

Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Était-ce utile?

La solution

If everything else fails, and the correct DLL is deployed in the bin, try adding an assembly binding redirect in the web.config:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="2.0.0.0" newVersion="1.8.0.0" />
</dependentAssembly>

Change the binding version numbers as needed.

Autres conseils

This happened to me because I updated the references from 2.0 to 2.2 but I still had the version 2.0 dll referenced in my web config:

<system.diagnostics>
<trace autoflush="true">
  <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
      <filter type="" />
    </add>
  </listeners>
</trace>

This happened to me when i upgraded to 2.3.0.0.

To fix it i went in to references -> right clicked the dll -> clicked Properties -> set copy local to true.

I believe I've hit the exact same issue as you (if I remember correctly). The 1.8 SDK contained a reference to the old StorageClient dll. Try adding a reference in your project to:

Microsoft.WindowsAzure.StorageClient version 1.7.0.0 

Let me know if this helps!

I had this issue as well recently. Based on my research this can be caused by a multitude of reasons. The best way to resolve this is to first diagnose it. To get a better diagnosis, enable all CLR exceptions from your Exceptions window. Now your Visual Studio will break on any kind of exception that is thrown. From here you should be able to see the inner details of the exception.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top