Reputation: 1025
Platform: Windows 7 (64 bit) Visual Studio 2012
I recently installed azure SDK 2.2 and got my solution running with the new references. However, if I use a previous version of my solution (with old references and SDK version - 2.0) I get this runtime exception:
Could not load file or assembly 'Microsoft.WindowsAzure.Storage, 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)
I had some hints from previous upgrades and understood that you may need to override the versions grabbed by Visual Studio if they aren't supposed to be the most recent so I added the following lines to me Web.config:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Configuration" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
I was hoping this would direct visual studio to grab the appropriate versions but it still fails.
Any help would be appreciated.
Upvotes: 1
Views: 627
Reputation: 11
Do you have both Azure SDK 2.0 and 2.2 installed on your machine side by side?
If that is the case you would not have to add these re-directs.
I have a machine with both 2.0 and 2.2 installed and the references are correctly resolved depending on if you are opening the project with 2.0 or 2.2.
Any information about the state of the project before you opened on the machine with 2.2
installed could help us in identifying the issue.
When you refer to opening previous version of solution with 2.0 references, do you mean you upgraded the solution using the upgrade wizard to 2.2? If this is the case, could you confirm if the upgrade was successful and you could build your project and are there any unresolved references in the solution explorer?
Also, it is recommended to update the Storage and other Nuget package references using the Nuget Package Manger update console. Did you update any of these references manually?
Upvotes: 1