5
votes

we're using VSO hosted build controller to run our CI builds. A build has started failing that was working fine.

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1697): Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

This assembly should resolve to the Azure SDK which should be included in the host according to http://listofsoftwareontfshostedbuildserver.azurewebsites.net/ although http://www.visualstudio.com/en-us/get-started/hosted-build-controller-vs.aspx states the host only supports upto 2.3. We have had this building though.

All our assemblies for Azure SDK are for version 2.4. It builds locally and there are no previous versions of the SDK installed on my machine. We have binding redirects like so...

<dependentAssembly>
    <assemblyIdentity name="Microsoft.WindowsAzure.Diagnostics" publicKeyToken="31BF3856AD364E35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
  </dependentAssembly>

Has anyone else seen this?

4
Does adding the binding redirects let you build? I was thinking about targeting the 2.3 version of the SDK to get it to buildcrabCRUSHERclamCOLLECTOR
We were building with the binding redirects targeting 2.4. We have wound it back to 2.3 and that builds.user1385713
We have all of a sudden started to get this too. Builds which have been targetting 2.4 have been building for weeks, and all of a sudden (since yesterday) we get the related error. e type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) Surely they have mistakenly removed this form their hosted build controllers?Kramer00
Microsoft have now resolved the issue blogs.msdn.com/b/vsoservice/archive/2014/10/22/…Andrew Poland

4 Answers

2
votes

You can fix this by setting the "Specific Version" property in your Microsoft.WindowsAzure.Diagnostics reference in the affected project, using Visual Studio (right click on the reference and choose Properties in Solution Explorer). This will cause the build server to use the 2.3 version of the assembly.

If you're using any new classes or methods in the 2.4 SDK this might not work but it at least gives you a temporary solution until MS gets the problem fixed.

Here's a picture of my working reference

Specific Version Reference for Azure Diagnostics Assembly

Finally, check out the link (Really old) for more info on specific reference version: http://www.codemag.com/article/0507041,

1
votes

I started experiencing same today. Not sure what has changed. Following was raised https://connect.microsoft.com/VisualStudio/feedback/details/1007907/error-deploying-to-azure-sdk-2-4

What I did to overcome this issue is that I created old style lib folder, and added diagnostics and runtime dll to it. I change my csproj to reference from there. And this seem to have fixed it

1
votes

The bug is now fixed. A workaround is no longer required to use Azure SDK 2.4.

0
votes

I added a powershell script to print out all libraries on the build server. A full guide on this can be found here. The script consists of the following line

gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* 

The Windows Azure Libraries for .NET - v2.4 was missing from the printed list, all other versions are available. This has been raised as an active bug on connect.microsoft.

Until this is fixed adding the 2.4 libraries to source or reverting to an earlier version of azure will be the only work around.