3
Vote

Found conflicts between different versions of the same dependent assembly that could not be resolved.

description

This warning keeps showing up in a .NET 4.5.1 MVC application I'm working on that uses the Unity application block for dependency injection, which references your project.
Warning 10  Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
After setting build log verbosity to detailed:
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".
4>      "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.
References which depend on "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" [].
4>          C:\Development\Projects\.....\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll
4>            Project file item includes which caused reference "C:\Development\Projects\.....\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll".
......(removed some application specific lines for brevity)
4>              Unity.WebApi
4>              Microsoft.Practices.Unity.Mvc
4>              Microsoft.Practices.Unity.Configuration, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
4>              Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
4>              Microsoft.Practices.Unity.RegistrationByConvention
4>              Microsoft.Practices.Unity.WebApi
4>              Microsoft.Practices.Unity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
Are you planning on releasing a version that targets the newer mscorlib? Is this related to issue 12616?

comments

enorl76 wrote Oct 23, 2015 at 1:48 PM

I'm running into the same issue. It appears that currently we'll have to do some Nuget hacking and "re-reference" all the nuget packages that depend on this currently. This is a BFD.