14
votes

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?

1
No, that's a normal warning when you a reference on a PCL assembly. You only ever see it when you "dig deeper".Hans Passant
Possible duplicate of mscorlib version conflict during buildamin

1 Answers

2
votes

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.