Newtonsoft.Json 版本冲突时解决方案

此方案适用于高版本的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-11.0.0.0" newVersion="9.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
 
如果项目中有多个引用版本
 

<dependentAssembly>
  <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" />
  <codeBase version="1.2.10.0" href="log4net1.2.10.0log4net.dll" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" />
  <codeBase version="2.0.8.0" href="log4net2.0.8.0log4net.dll" />
</dependentAssembly>

原文地址:https://www.cnblogs.com/yswenli/p/7729737.html