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.
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)
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With