MSBuild conflict between mscorlib 4.x and mscorlib 2.x
Asked Answered
Y

1

15

I was investigating a build failure recently and saw a warning about conflicts between assemblies. I dug deeper and MSBuild told me this:

There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it was primary and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" was not.`

My solution contains several console applications, lots of class libraries and ASP.NET application. We build on .NET 4.5.2.

Should I be concerned?

Yaakov answered 25/10, 2016 at 14:27 Comment(2)
No, that's a normal warning when you a reference on a PCL assembly. You only ever see it when you "dig deeper".Aerification
Possible duplicate of mscorlib version conflict during buildMitinger
R
2

When using PCL libraries it is better add Microsoft.Bcl.Build Nuget package which will attempt to resolve this issue for your. Also you should investigate dependencies of your class libraries and find where you depends on the PCL library.

Reginareginald answered 3/5, 2018 at 2:42 Comment(1)
I do this on Visual Studio Mac, However, the build process still gives the same errorUlceration

© 2022 - 2024 — McMap. All rights reserved.