类型存在于& of Newtonsoft.Json"更新到10.0.2后

时间:2017-05-01 10:23:33

标签: c# nuget

我在VS2017中内置了net461 cs项目,project.json用于nuget,在通过VS nuget工具更新到10.0.2之后看起来像:

{
  "version": "1.0.0-*",
  "dependencies": {
    "IppDotNetSdkForQuickBooksApiV3": "2.9.1",
    "Microsoft.Extensions.Logging": "1.1.1",
    "Newtonsoft.Json": "10.0.2"
  },
  "frameworks": {
    "net461": {}
  },
  "runtimes": {
    "win": {}
  }
}

这给了The type 'JsonPropertyAttribute' exists in both 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed',因为IppDotNetSdkForQuickBooksApiV3是用json.net v9。*构建的。

我还添加了add.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>            
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.2.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

csproj中没有任何引用,除了ProjectReference(所有引用都没有newtonsoft.json依赖)。

0 个答案:

没有答案