Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.0.0.0
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>
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.