简体   繁体   中英

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?

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

Azure诊断程序集的特定版本参考

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

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM