报错:未能加载文件或程序集“System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
解决:
一、 查看项目中 “引用”的节点下,看有没有System.Runtime.CompilerServices.Unsafe,
如果有,就去web.config 中的 configuration 标签里面添加如下代码:
注意:6.0.0.0 为你的 System.Runtime.CompilerServices.Unsafe 的安装版本
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
二、如果没有 引用: 在项目中添加 Nuget包:System.Runtime.CompilerServices.Unsafe
如果添加后还是报错那就重复 我上面所说的描述 添加到 web.config中
这样就完美解决啦
1万+

被折叠的 条评论
为什么被折叠?



