Json   发布时间:2022-04-22  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了.net – 与Newtonsoft.Json的汇编冲突大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要加载两个版本的汇编Newtonsoft.Json vesion 4.0.8.0和4.5.0.0
现在在我的配置文件中:
<dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
</dependentAssembly>

但是我需要老4.0.8.0和4.5.0.0

<dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.5.0.0" />
      </dependentAssembly>

我从Package Console安装最后一个版本,但它给我错误

错误80无法加载文件或程序集“Newtonsoft.Json,Version = 4.5.0.0,Culture = neutral,PublicKeyToken = 30ad4fe6b2a6aeed”或其一个依赖项.找到的程序集的清单定义与程序集引用不匹配. (HRESULT的异常:0x80131040)

我今天遇到了这个问题,我在这link中找到了解决方案.

基本上更新了Newtonsoft.Json包.并在web.config注册此程序集

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
    <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="5.0.8"/>
</dependentAssembly>

大佬总结

以上是大佬教程为你收集整理的.net – 与Newtonsoft.Json的汇编冲突全部内容,希望文章能够帮你解决.net – 与Newtonsoft.Json的汇编冲突所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。