project-system: VS2017RC3 - Assembly conflicts because of the same name
I have an interesting situation: I have a project called Newtonsoft.Json
that I want to test in netcoreapp1.0
, but the Microsoft.NET.Test.Sdk
package that I have to depend on to run tests has a dependency on a NuGet package called Newtonsoft.Json
.
I get this warning when I build in VS2017RC3:
Warning MSB3243 No way to resolve conflict between “Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed” and “Newtonsoft.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”. Choosing “Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed” arbitrarily.
And lots of this error:
error CS0433: The type ‘JsonConstructorAttribute’ exists in both ‘Newtonsoft.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
How do I tell the Roslyn/msbuild/.NET Core that I want the referenced Newtonsoft.Json
project to be used?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 31 (31 by maintainers)
I filed https://github.com/Microsoft/msbuild/issues/1712 against MSBuild because I hate this warning.
Ok! Closed