9
votes

I had a project up and running with the November 2011 SDK and recently upgraded to the June 2012 SDK. When I first saw the error, I attempted the obvious - remove references and add the later versions, but that didn't help. Somehow it seems that version 1.0.0.0 is still being requested. I've also attempted to remove the reference and add the old version back, but no luck.

Here's how it shows up in my code. The first Trace.WriteLine that hits now reports the following exception:

System.IO.FileLoadException was unhandled by user code Message=Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.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) Source=mscorlib
FileName=Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 FusionLog==== Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///F:/SVNProjects/myproject/SitePagesWebRole/ LOG: Initial PrivatePath = F:\SVNProjects\myproject\SitePagesWebRole\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: F:\SVNProjects\myproject\SitePagesWebRole\web.config LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Post-policy reference: Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/b117acb8/f2404402/Microsoft.WindowsAzure.Diagnostics.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/b117acb8/f2404402/Microsoft.WindowsAzure.Diagnostics/Microsoft.WindowsAzure.Diagnostics.DLL. LOG: Attempting download of new URL file:///F:/SVNProjects/myproject/SitePagesWebRole/bin/Microsoft.WindowsAzure.Diagnostics.DLL. WRN: Comparing the assembly name resulted in the mismatch: Minor Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

StackTrace: at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at System.Type.GetType(String typeName) at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) at System.Diagnostics.TypedElement.BaseGetRuntimeObject() at System.Diagnostics.ListenerElement.GetRuntimeObject() at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() at System.Diagnostics.TraceInternal.get_Listeners() at System.Diagnostics.TraceInternal.WriteLine(String message) at myproject.GameAPI.Login(Int64 fbid, Int64[] friends) in F:\SVNProjects\myproject\GameLogic\GameAPI.cs:line 119
InnerException:

How can this be solved?

3

3 Answers

14
votes

Check the web.config / app.config for all your roles. Make sure that you change the version number for any reference to the Microsoft.WindowsAzure.Diagnostics assembly to version 1.7.0.0

2
votes

All your azure assembly references in your web/worker role projects should point to 1.7.0.0 Versions. Your ccproj files should contain

<ProductVersion>1.7</ProductVersion>

to ensure that the Azure instances contain the proper base assemblies.

You could also check if Microsoft.WindowsAzure.Diagnostics is copied to the output/azure package.

1
votes

The above didn't work for me (everywhere I looked it said 1.7), instead I went through each project, removed and re added any reference that started with:

Microsoft.WindowsAzure.*

When you re-add them make sure it says version 1.7.