簡體   English   中英

始終使用Newtonsoft.Json的最新版本

[英]Always use latest version of Newtonsoft.Json

我有一個.NET項目,該項目引用依賴於Newtonsoft.Json版本6.0.8的nuget。 nuget是https://www.nuget.org/packages/Microsoft.Azure.KeyVault/3.0.2

我只想在項目中使用Newtonsoft的最新版本,所以我希望該項目實際使用Newtonsoft的12.0版本。 我不確定這是否可能。 我嘗試將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>

有什么辦法可以實現?

我解決了該問題,使該項目明確引用了Newtonsoft的最新版本。 一切似乎都正常。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM