Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Multiple assemblies with equivalent identity have been imported. #588

Closed
kharlamov opened this issue Apr 10, 2017 · 12 comments
Closed

Comments

@kharlamov
Copy link

kharlamov commented Apr 10, 2017

Hello I have a .NET 4.6.2 application referencing a DLL built on .NET Core 1.1 along with the System,Runtime.dll (4.1.0).

This seems to work without any issues on any computer with the two runtimes and a minimum of VS2015 installed. However, our build servers (Windows Server 2008 R2) are missing VS and are not building the project instead erroring with msbuild:

CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'D:\BuildAgent\work\2973dc142048b0ec\packages\System.Runtime\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. [D:\BuildAgent\work\2973dc142048b0ec\src\ProjectName\5elyknl3.tmp_proj]

I have installed VS2015 on one of the build servers just to verify, and the project started working and building. That being said is there anyway to fix this without having to go to each server and doing a full install of VS?

@karelz
Copy link
Member

karelz commented Apr 10, 2017

@weshaggard @ericstj does it sound familiar? If not, do you know where to route it?

@weshaggard
Copy link
Member

It sounds like a issue with the msbuild filtering issue with the facades. I think that was fixed in a newer version of msbuild. @cdmihai @AndyGerlicher do you knows what is necessary to fix this?

@cdmihai
Copy link

cdmihai commented Apr 10, 2017

AFAIK, the change we did was to allow Nuget based dependencies to win against the ones on disk: dotnet/msbuild#1520

@ericstj or @dsplaisted should know the scenarios better for this.

@kharlamov
Copy link
Author

kharlamov commented Apr 11, 2017

If it helps I do have the 4.6.2 SDK installed on those servers that do not compile the code.

Small discovery, copying the C:\Program Files (x86)\MSBuild\14.0 from the VS server to the non VS Server fixes the issue.

The non VS folder structure only has the Bin folder and ThirdPartyNotices where as the VS server has Bin, Imports, Microsoft.Common.Targets folders and Microsoft.Common, Microsoft.VisualStudioVersion.v14.Common project property files. The Bin folders also do not have the same amount of files.

@richlander
Copy link
Member

Is this still an issue?

@kharlamov
Copy link
Author

kharlamov commented Jul 3, 2017

Besides the work around I provided, yes this is still a problem

@richlander
Copy link
Member

@terrajobst @weshaggard it looks like we still need to do something.

@ericstj
Copy link
Member

ericstj commented Jul 5, 2017

However, our build servers (Windows Server 2008 R2) are missing VS and are not building the project instead erroring with msbuild

Can you clarify which MSBuild you are using to do this?

@kharlamov
Copy link
Author

@RJSchmertz could you look into what version the build servers are using.

@RJSchmertz
Copy link

RJSchmertz commented Jul 5, 2017

devbuild01 says 4.6.1590.0 when running .\MSBuild.exe -version from the latest version folder, \%windir%\Microsoft.NET\Framework\v4.0.30319

@ericstj
Copy link
Member

ericstj commented Jul 5, 2017

That's the MSBuild that's built into the desktop framework. I wouldn't recommend using that to build new projects, it's missing quite a lot of fixes, and will be substantially different than the MSBuild used by VS 2015. I could give you workarounds to make that old MSBuild work but that's just treating the symptoms and you could have more issues crop up in the future.

I believe the MSBuild team produces a standalone package for build servers so that you don't have to install all of VS: https://www.microsoft.com/en-us/download/details.aspx?id=48159. I'd reccomend using that to make your build machines closer to your dev environment (without installing all of VS, which I gather is undesirable).

@kharlamov
Copy link
Author

That works, dev ops can roll that out to the build servers. Thank you Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants