This error message has been the bane of .NET developers for years. Having worked on assembly resolution for ~6 years in the BCL team, I've diagnosed so many of these warnings for customers, and there's three issues that I see with it:
Developers don't know what this message means.
Developers once they know what it means, don't know how to fix it.
The warning is not actionable without building again with diagnostic build (if you can figure out how to do that). Even then you need to search for the issue in the log, and find the relevant portions.
Here's a typical log:
There was a conflict between "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
"Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll].
C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
Project file item includes which caused reference "C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll".
C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll
Project file item includes which caused reference "C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll".
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\testhost.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1956,5): warning MSB3277: 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.
Note the warning states:
warning MSB3277: 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.
But really the relevant portion is 1#:
There was a conflict between "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
and 2#
References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll].
C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
Project file item includes which caused reference "C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll".
C:\Users\James\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll
Project file item includes which caused reference "C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll".
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll
C:\Users\James\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170210-02\lib\netstandard1.5\testhost.dll
We should promote 1# or something like it as the root message, and 2# as a nested message under the warning. VS will now hide by default messages that too long or contain multiple lines, and let the user expand to see more detail.
馃挴
Dupe of #608. Copying your comments over there.
What if the diagnostic output shows the warning MSB3277, but doesn't list any conflicts?
Most helpful comment
What if the diagnostic output shows the warning MSB3277, but doesn't list any conflicts?