Could not load file or assembly ‘Newtonsoft.Json, Version=8.0.0.0, Culture=neutral... 问题解决

Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

在提高产品安全,升级引用外包 ‘Newtonsoft.Json’的版本时 ,可能会遇到的下面的问题:

问题: 环境配置的版本不匹配

解决方法:

1,找到路径:\\ bin\Newtonsoft.Json.dll

 

2,打开Newtonsoft.Json.dll

3,双击 ‘1(Neutral)’

4,找到对应的版本更新到配置文件中,重启环境 即可

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这个错误提示是说,在你的项目中,Newtonsoft.Json 程序集引用了高于你项目中的 System.Runtime 程序集版本的版本。这可能会导致一些兼容性问题,从而导致编译错误。 要解决这个问题,可以尝试以下几种方法: 1. 更新你的项目中的 System.Runtime 程序集版本,使其与 Newtonsoft.Json 引用的版本匹配。你可以通过 NuGet 包管理器来更新 System.Runtime 程序集,或者手动引用高版本的 System.Runtime 程序集。 2. 更新你的项目中的 Newtonsoft.Json 程序集版本,使其与 System.Runtime 引用的版本匹配。你可以通过 NuGet 包管理器来更新 Newtonsoft.Json 程序集,或者手动引用与 System.Runtime 版本匹配的 Newtonsoft.Json 程序集。 3. 如果以上方法都不行,可以尝试将你的项目中的 Newtonsoft.Json 程序集和 System.Runtime 程序集强制使用相同的版本。你可以在项目的 App.config 文件中添加以下代码: ``` <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="4.1.2.0" /> </dependentAssembly> ``` 这段代码可以将 Newtonsoft.Json 和 System.Runtime 强制使用相同的版本,从而解决版本兼容性问题。 希望以上方法能够帮助你解决问题

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值