未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”

这时你需要在config文件中加些配置了:

在runtime的节点里面  加上一段:

 <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>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误提示是说,在你的项目中,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 强制使用相同的版本,从而解决版本兼容性问题。 希望以上方法能够帮助你解决问题。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值