Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Online Hosted Build Controller Could not locate the assembly Microsoft.WindowsAzure.Diagnostics

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?

like image 990
user1385713 Avatar asked Sep 30 '22 13:09

user1385713


2 Answers

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,

like image 63
Joe Avatar answered Oct 06 '22 19:10

Joe


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

like image 44
Umang Avatar answered Oct 06 '22 18:10

Umang