参考https://blog.csdn.net/WPwalter/article/details/89052379

问题场景

MVC项目中引用Framework3.5的项目,两个项目都有引用Newtonsoft.Json,但是MVC引用的4.5,旧项目引用的是3.5版本的。运行报错关于项目中引用NewtonSoft.Json.dll版本找不到的问题

通过报错日志发现MVC原生生成的重定向成功但是无效。如下:
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="b9a188c8922137c6"  culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>

解决办法

在dependentAssembly中加入如下代码,即可成功定向找到不同版本的dll.

关于项目中引用NewtonSoft.Json.dll版本找不到的问题

 

相关文章:

  • 2022-12-23
  • 2021-04-09
  • 2021-11-14
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-01-03
猜你喜欢
  • 2022-01-02
  • 2021-12-24
  • 2021-04-21
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
相关资源
相似解决方案