2
votes

I can't figure out how to solve this issue in my case.

Multiple assemblies with equivalent identity have been imported: 'D:\TfsBuild\Agents\Company.Framework\c57207ab\X\Y\DotNet\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Runtime.dll'. Remove one of the duplicate references.

Once I go to the affected project file, I find an unique reference to System.Runtime.dll:

<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
  <Private>True</Private>
</Reference>

What's going on?

2
I've only found a difference between my dev machine and build machine. My dev machine has VS2015 Update 3, while the build machine has VS2015 without updates at all. I'm installing U3 on my build machine and let's see what happens.. - Matías Fidemraizer
Do you resolve the issue by upgrade your build machine to visual studio 2015 update3, if you resolve the issue, please post a answer and mark it as answer, it will be beneficial to other community. - Zhanglong Wu - MSFT
@ColeWu-MSFT Of course. I was going to know if this was the fix, but I couldn't go to work today. I'll know if it worked tomorrow! :) - Matías Fidemraizer
@ColeWu-MSFT Yeah! This was the issue, I added an answer! - Matías Fidemraizer

2 Answers

1
votes

I encountered this error when committing code to GitHub that auto-deployed to Azure. The resolution for my situation was to add this following NuGet package:

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

For whatever reason, the Azure build process is not using the same process that is used by Visual Studio 2017. So, this hack seems to workaround that difference.

0
votes

Hopefully, the issue was a Visual Studio 2015 version mismatch between my development and build machine.

While my development machine was building the whole solution successfully, my TFS Build was failing. After digging on the issue, finally I found that my development machine has Visual Studio 2015 Update 3 while the build machine had Visual Studio 2015 with no update at all.

Updating my build machine to Visual Studio 2015 solved the issue!