Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild conflict between mscorlib 4.x and mscorlib 2.x

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?

like image 511
chester89 Avatar asked Oct 25 '16 14:10

chester89


1 Answers

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.

like image 148
codevision Avatar answered Oct 07 '22 10:10

codevision