我面临下面无法加载文件或程序集“Newtonsoft.Json,版本= 7.0.0.0
无法加载文件或组件中的错误” Newtonsoft.Json,版本= 7.0.0.0, 文化=中立,PublicKeyToken = 30ad4fe6b2a6aeed'或其 依赖项之一。找到的程序集的清单定义不符合程序集引用的 。 (异常来自HRESULT:0x80131040)
我可以看到在Web.config中
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
以下于是我改成了
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.1.0" />
</dependentAssembly>
在packeges.config我可以看到下面的条目
但我仍面临同样的问题。请帮忙
原因可能很多。首先:检查输出文件夹中的程序集,并检查文件版本和强名称是否符合您的期望。我怀疑强名称版本是7.0.0.0所以更改bindingRedirect(强名称和文件版本可能会有所不同 - 它为Newtonsoft.Json 6. *)。 –