代码之家  ›  专栏  ›  技术社区  ›  Cyan

始终使用最新版本的newtonsoft.json

  •  0
  • Cyan  · 技术社区  · 6 年前

    我有一个.NET项目引用了一个依赖于newtonsoft.json版本6.0.8的nuget。NuGET是 https://www.nuget.org/packages/Microsoft.Azure.KeyVault/3.0.2

    我只想在我的项目中使用最新版本的NewtonSoft,所以我希望这个项目实际使用12.0版本的NewtonSoft。我不确定这是否可行。我试图在我的项目中添加app.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-11.0.1.0" newVersion="12.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    

    我有什么办法可以做到吗?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Cyan    6 年前

    我解决了这个问题,我让这个项目明确地引用了最新版本的牛顿力学。一切似乎都正常。

    <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />