作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图将我的项目更新到 .NET Standard 2.0,在测试过程中我发现了一个异常:
System.IO.FileLoadException: 'Could not load file or assembly "System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" or one of its dependencies. The definition of the assembly manifest found does not match the reference to the assembly.
最佳答案
我通过启用 Automatic Binding Redirection 解决了这个问题在我的 .NET Framework 4.7 项目(引用 .NET Standard 2.0 库)中。可以通过手动编辑项目的 .csproj
来启用绑定(bind)重定向。文件并添加以下片段 Project
的子项元素:
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
app.config
的必要程序集重定向。 ,类似这样:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
关于.net-standard - 无法加载文件或程序集 "System.ValueTuple, Version=0.0.0.0"或其依赖项之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44844798/
我是一名优秀的程序员,十分优秀!