Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0 when deployed to the cloud Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0 when deployed to the cloud azure azure

Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0 when deployed to the cloud


So from your screenshot it looks like you created a Web Site (which isn't a Cloud Service or a Web Role). The assemblies Microsoft.WindowsAzure.Diagnostics and Microsoft.WindowsAzure.ServiceRuntime cannot be used in a Web Site.

If you want to create a Web Role, open Visual Studio > File > New Project > Cloud > Windows Azure Cloud Service > Add an MVC Web Role > OK. Once you're done, right click the Azure project and choose Publish. This will allow you to create a new Cloud Service which will contain your Web Role. And if you create your project like this you will be able to use the Microsoft.WindowsAzure.Diagnostics and Microsoft.WindowsAzure.ServiceRuntime assemblies.


Check the references in your project and make sure that all Azure references are marked Copy Local = True. Also since the app is looking for Runtime version 1.8, you are obviously using at least one assembly from SDK 1.8 - C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-10\ref... NOTE: 2012-10. Then check the reference versions in use:

  • Diagnostics: 1.8.0.0
  • Runtime: 1.8.0.0

This assembly mis-match typically happens because you have different SDK versions referenced and/or your ref's are not marked copy local = true.

As for Azure taxonomy, there are Websites (on portal under websites) and there are Cloud Services which can have either WebRoles (websites, wcf services) or WorkerRoles (backend processing).

For CloudServices, the OS Family and GuestOS are specified in the ServiceConfiguration.cscfg file in the "ServiceConfiguration" element:

<ServiceConfiguration serviceName="MyWebRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2012-10.1.8">

osFamily 2 = Server 2008R2 and 3 = Server 2012. The osVersion specifies the GuestOS and should almost always be "*" for the latest version.

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

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


Since you're getting the error when trying to start the DiagnosticMonitor, can you check that you are referencing the 1.8 version of Microsoft.WindowsAzure.Diagnostics too?

It should be located at C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-06\ref.