大会的冲突Newtonsoft.Json [英] Assembly Conflict with Newtonsoft.Json

查看:238
本文介绍了大会的冲突Newtonsoft.Json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要装载2版本的组件Newtonsoft.Json vesion 4.0.8.0和4.5.0.0 现在我的配置文件:

I need to load 2 versions of assembly Newtonsoft.Json vesion 4.0.8.0 and 4.5.0.0 now in my config file :

<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

but I need to be old 4.0.8.0 and new 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>

我从包控制台安装的最后一个版本,但它给我的错误:

I install from Package Console the last version but it give me error:

错误80未能加载文件或程序集Newtonsoft.Json,版本= 4.5.0.0,文化=中性公钥= 30ad4fe6b2a6aeed或它的某一个依赖。找到的程序集清单定义不匹配的程序集引用。 (从HRESULT异常:0x80131040)

推荐答案

今天我这个问题,我找到了解决办法在此的链接

I got this problem today, I found the solution in this link.

基本上更新Newtonsoft.Json包。而在web.config中注册该程序集

Basically update the Newtonsoft.Json package. And register this assembly in the web.config

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

这篇关于大会的冲突Newtonsoft.Json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆