Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load 'Microsoft.WindowsAzure.ServiceRuntime' assembly after update to Azure SDK 2.0

So I updated the Azure SDK to the 2.0 version yesterday and upgraded my projects. Everything worked fine in local, so I published to Azure. Surprise: the worker role didn't start because of the following exception

Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.0.0.0

Something similar happened when I updated to 1.8 but I don't remember the exact solution. I've tried to remove and readd the assembly, referencing to the DLL in my system, updating the NuGet packages... everything yields the same result.

Anyone has any solution to this? Thanks!

like image 941
gjulianm Avatar asked May 12 '13 21:05

gjulianm


2 Answers

I've not done the migration to 2.0 yet but it is on the cards.

When I last upgraded 1.7 => 1.8 I had to add the following entry to my web.config because of other external projects still referencing the old runtime

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.7.0.0-1.8.0.0" newVersion="1.8.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>
like image 171
Shaun Wilde Avatar answered Nov 18 '22 07:11

Shaun Wilde


If you have checked your own projects and they don't refer to the old version it could be that some nuget package still contains references to the old versions.

In my case the problem was the Azure Storage Client library, which was referring to the older version of configuration package which was then referring to these version 1.8 DLLs.

Don't know what would be the best way to debug these, but the Nuget package dependency visualizer might help: Tools -> Library Package Manager -> Package Visualize (looks like you can only create the visualizations in Visual Studio ultimate)

like image 2
Juha Palomäki Avatar answered Nov 18 '22 09:11

Juha Palomäki