问题描述
中文
未能加载文件或程序集“ System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” 或它的某一个依赖项。系统找不到指定的文件
English
Could not load file or assembly ‘System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.
解决
我的System.Runtime.CompilerServices.Unsafe
的版本是6.0.0.0
在app.config文件或web.config文件中添加以下内容, 执行0.0.0.0~6.0.0.0版本的都是用6.0.0.0版本
<configuration>
<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>
</configuration>
其他
本文只用于作者记录日常解决的一些小问题, 如果有更好的解决方案或者有啥问题, 欢迎留言分享