我在 Visual Studio 2019 中启动了一个新的 Web 应用程序。我添加了一个 Web Api。不久之后或同时(不记得了),我开始收到这样的警告:
Warning No way to resolve conflict between "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Choosing "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" arbitrarily.
Run Code Online (Sandbox Code Playgroud)
我注意到但没有做任何事情,因为我决定等到它给我带来问题。
而现在...
我将要使用一个 JSon 对象,但是在写这个的时候:
JObject jObject = JObject.Parse(result);
Run Code Online (Sandbox Code Playgroud)
编译器给了我这个错误:
Error CS0433 The type 'JObject' exists in both 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
Run Code Online (Sandbox Code Playgroud)
我在网上搜索了一下,得出的结论如下:
<dependentAssembly><assemblyIdentity name="Newtonsoft.Json" …