未能加载文件或程序集“Newtonsoft.Json”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)

报错:

解决办法:将原有的

Newtonsoft.Json.dll移除掉,再将Package.config里面的版本信息注释掉,通过NuGet程序管理重新安装,然后重新生成就行了。

如果不行也可以在web.config里面加上

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

步骤截图:

1、

2、

3、

4、

posted @ 2016-04-26 09:55  闲得无聊敲代码  阅读(6922)  评论(0编辑  收藏  举报