未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0[已解决]

在使用百度UEditor,不小心将Newtonsoft.Json,升级了,然后就报的一个错,说:

其他信息: 未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040),各种清理解决方案都不行

,后来在网站找到了一个方法 ,说插入以下代码就可以了:

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

试了一下,成功解决问题,估计是重写了默认配置的对Json.net的引用,不太懂,还需要学习:

原文地址

原文地址:https://www.cnblogs.com/huoqishi/p/4355021.html