When running my .NET project I get the following run-time error:
Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
From what I understand, Microsoft.WindowsAzure.ServiceRuntime
is a GAC dependency and not available on NuGet.
My .NET project is referencing 2.5.0.0 of ServiceRuntime from the Azure SDK 2.5. The stacktrace of the exception reveals that one of our custom NuGet packages references 2.4.0.0.
When looking at the NuGet package's dependencies, it doesn't show ServiceRuntime, which I assume is because it is a GAC reference (something which NuGet cannot resolve):
I found that by adding the following web.config
change, it now works:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
</dependentAssembly>
I would assume that this only works if 2.5.0.0 is backwards compatible with the 2.4.0.0 specification.
Questions:
- What would happen if it was not backwards compatible?
- Why isn't
Microsoft.WindowsAzure.ServiceRuntime
a NuGet package?