We have a classic WebApi .NET Framework project that references projects that is either netstandard1.6 and netstandard2.0.
Some of our core projects uses EF Core 2.0 (which uses netstandard 2.0), while the Microsoft.AspNet.OData library references netstandard1.6. But this genereates lots of conflicts warnings on assemblies within these standards when building like these (there are more warnings than these):
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.AppContext.dll' and 'Reference:C:\Users\<user>\.nuget\packages\system.appcontext\4.1.0\ref\netstandard1.6\System.AppContext.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.AppContext.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\microsoft.win32.registry\4.0.0\runtimes\unix\lib\netstandard1.3\Microsoft.Win32.Registry.dll' and 'Runtime:C:\Users\<user>\.nuget\packages\microsoft.win32.registry\4.0.0\runtimes\win\lib\netstandard1.3\Microsoft.Win32.Registry.dll'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\fedora.23-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\fedora.24-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\opensuse.13.2-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\opensuse.42.1-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\rhel.7-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\ubuntu.14.04-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\ubuntu.16.04-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\debian.8-x64\native\System.Security.Cryptography.Native.OpenSsl.so' and 'Runtime:C:\Users\<user>\.nuget\packages\runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl\4.3.0\runtimes\ubuntu.16.10-x64\native\System.Security.Cryptography.Native.OpenSsl.so'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\system.diagnostics.process\4.1.0\runtimes\linux\lib\netstandard1.4\System.Diagnostics.Process.dll' and 'Runtime:C:\Users\<user>\.nuget\packages\system.diagnostics.process\4.1.0\runtimes\osx\lib\netstandard1.4\System.Diagnostics.Process.dll'. Could not determine winner due to equal file and assembly versions.
1> Encountered conflict between 'Runtime:C:\Users\<user>\.nuget\packages\system.diagnostics.process\4.1.0\runtimes\linux\lib\netstandard1.4\System.Diagnostics.Process.dll' and 'Runtime:C:\Users\<user>\.nuget\packages\system.diagnostics.process\4.1.0\runtimes\win\lib\netstandard1.4\System.Diagnostics.Process.dll'. Could not determine winner due to equal file and assembly versions.
What impact does these have?
I thought that the idea with these standards was that they should be backward compatible? There shouldn't be any warnings for this at all.
I find the whole standard thing very non-standard compatible, this is one of the problems I have mixing projects that uses different standards. So it is quite frustrating now.
@dsplaisted any ideas?
Most of those conflicts should be fixed with VS 15.4 (specifically, via this PR).
I'm not sure about the first one though, do you have a simple repro project you can share where these warnings occur?
Thanks!
@dsplaisted I don't currently have that. I am a bit busy this week, but I'll try to get some time for it!
The attached project generates the following warnings on my machine:
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Temp\SampleProjects\Framework.Common\Framework.Common\obj\project.assets.json
Restore completed in 20.94 ms for C:\Temp\SampleProjects\Framework.Common\Framework.Common\Framework.Common.csproj.
1>------ Build started: Project: Framework.Common, Configuration: Debug Any CPU ------
1>Target _HandlePackageFileConflicts:
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Collections.NonGeneric.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.collections.nongeneric\4.3.0\ref\netstandard1.3\System.Collections.NonGeneric.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Collections.NonGeneric.dll' because AssemblyVersion '4.0.3.0' is greater than '4.0.1.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel\4.3.0\ref\netstandard1.0\System.ComponentModel.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.dll' because AssemblyVersion '4.0.1.0' is greater than '4.0.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.Primitives.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel.primitives\4.3.0\ref\netstandard1.0\System.ComponentModel.Primitives.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.Primitives.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.TypeConverter.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel.typeconverter\4.3.0\ref\netstandard1.5\System.ComponentModel.TypeConverter.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ComponentModel.TypeConverter.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Dynamic.Runtime.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.dynamic.runtime\4.3.0\ref\netstandard1.3\System.Dynamic.Runtime.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Dynamic.Runtime.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Globalization.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.globalization\4.3.0\ref\netstandard1.3\System.Globalization.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Globalization.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.IO.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.io\4.3.0\ref\netstandard1.5\System.IO.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.IO.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Linq.Expressions.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq.expressions\4.3.0\ref\netstandard1.6\System.Linq.Expressions.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Linq.Expressions.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ObjectModel.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.objectmodel\4.3.0\ref\netstandard1.3\System.ObjectModel.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.ObjectModel.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Reflection.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection\4.3.0\ref\netstandard1.5\System.Reflection.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Reflection.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Reflection.Primitives.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.primitives\4.3.0\ref\netstandard1.0\System.Reflection.Primitives.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Reflection.Primitives.dll' because AssemblyVersion '4.0.1.0' is greater than '4.0.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime\4.3.0\ref\netstandard1.5\System.Runtime.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.dll' because AssemblyVersion '4.1.2.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.Serialization.Formatters.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime.serialization.formatters\4.3.0\ref\netstandard1.3\System.Runtime.Serialization.Formatters.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.Serialization.Formatters.dll' because AssemblyVersion '4.0.2.0' is greater than '4.0.1.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.Serialization.Primitives.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime.serialization.primitives\4.3.0\ref\netstandard1.3\System.Runtime.Serialization.Primitives.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Runtime.Serialization.Primitives.dll' because AssemblyVersion '4.1.3.0' is greater than '4.1.1.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Text.Encoding.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.text.encoding\4.3.0\ref\netstandard1.3\System.Text.Encoding.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Text.Encoding.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Threading.Tasks.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.threading.tasks\4.3.0\ref\netstandard1.3\System.Threading.Tasks.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Threading.Tasks.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Xml.ReaderWriter.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.xml.readerwriter\4.3.0\ref\netstandard1.3\System.Xml.ReaderWriter.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Xml.ReaderWriter.dll' because AssemblyVersion '4.1.1.0' is greater than '4.1.0.0'.
1> Encountered conflict between 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Xml.XmlDocument.dll' and 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.xml.xmldocument\4.3.0\ref\netstandard1.3\System.Xml.XmlDocument.dll'. Choosing 'Reference:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\\ref\System.Xml.XmlDocument.dll' because AssemblyVersion '4.0.3.0' is greater than '4.0.1.0'.
1> Encountered conflict between 'Runtime:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.globalization.extensions\4.3.0\runtimes\unix\lib\netstandard1.3\System.Globalization.Extensions.dll' and 'Runtime:C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.globalization.extensions\4.3.0\runtimes\win\lib\netstandard1.3\System.Globalization.Extensions.dll'. Could not determine winner due to equal file and assembly versions.
1>Target GenerateTargetFrameworkMonikerAttribute:
1> Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>Target CoreGenerateAssemblyInfo:
1> Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
1>Target CoreCompile:
1> Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn
1>Target CopyFilesToOutputDirectory:
1> Copying file from "obj\Debug\netstandard2.0\Framework.Common.dll" to "bin\Debug\netstandard2.0\Framework.Common.dll".
1> Framework.Common -> C:\Temp\SampleProjects\Framework.Common\Framework.Common\bin\Debug\netstandard2.0\Framework.Common.dll
1> Copying file from "obj\Debug\netstandard2.0\Framework.Common.pdb" to "bin\Debug\netstandard2.0\Framework.Common.pdb".
1>Target CleanupEmptyRefsFolder:
1> Directory "C:\Temp\SampleProjects\Framework.Common\Framework.Common\bin\Debug\netstandard2.0\refs" doesn't exist. Skipping.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
I get these same set of conflicts when building packages targeting netstandard1.x and netstandard2.0. I've been able to resolve the issue in some cases where I only in reference packages for 1.x and not including any of those same references for 2.0 (because most seem to be baked into 2.0). However, when I reference 3rd party nuget packages, it seems I lose the ability to control that as it's being introduced externally. I'm on VS2017 15.4 also. So it doesn't seem to be fixed.
Newtonsoft.Json 10.0.3 is a prime example of this as it doesn't specify a netstandard2.0 target explicitly. So anything that consumes it targeting 2.0 immediately gets conflicts because of all the 1.x specific dependencies listed from package.
Any ideas on how to control this behavior?
Is there any update on this? I recently upgraded all of our projects to the new vs2017 project format with package references and now am getting 100s of these messages on build.
Encountered conflict between 'Reference:C:\Users\colin\.nuget\packages\netstandard.library\2.0.0\build\netstandard2.0
\ref\System.Collections.dll' and 'Reference:C:\Users\colin\.nuget\packages\system.collections\4.0.11\ref\netstandard1
.3\System.Collections.dll'. Choosing 'Reference:C:\Users\colin\.nuget\packages\netstandard.library\2.0.0\build\netst
andard2.0\ref\System.Collections.dll' because AssemblyVersion '4.0.11.0' is greater than '4.0.10.0'
Are these warnings an issue? Could these warnings be hiding anything serious?
Its easy to repro:
Create a .netstandard2.0 project.
Add reference to newtonsoft.json (v9 in our case)
Build
@qfcolin that message is expected in cases where the older System.Collections package is still pulled into the graph. The right thing is happening and shouldn't cause any issues.
Until we get more of the library packages in the .NET ecosystem moved to .NET Standard 2.0 you will see a lot of these conflicts in the diag log (not these aren't build warnings or errors) it is just a verbose log explaining what is happening and they are expected.
Most helpful comment
I get these same set of conflicts when building packages targeting netstandard1.x and netstandard2.0. I've been able to resolve the issue in some cases where I only in reference packages for 1.x and not including any of those same references for 2.0 (because most seem to be baked into 2.0). However, when I reference 3rd party nuget packages, it seems I lose the ability to control that as it's being introduced externally. I'm on VS2017 15.4 also. So it doesn't seem to be fixed.
Newtonsoft.Json 10.0.3 is a prime example of this as it doesn't specify a netstandard2.0 target explicitly. So anything that consumes it targeting 2.0 immediately gets conflicts because of all the 1.x specific dependencies listed from package.
Any ideas on how to control this behavior?