Newtonsoft.Json版本沖突時參考解決方案


如果同一項目中不同第三方類庫分別使用了不同版本的Newtonsoft.Json的情況下,可以在配置文件中添加以下節點,將0.0.0.0-9.0.0.0此區間的Newtonsoft.Json使用全部強制指向到8.0.0.0版本。

此方案適用於高版本的Newtonsoft.Json向下兼容!

 

  <runtime>
    <assemblyBinding xmlns=" urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM