嗨伙计,
我的控制台应用程序(FW 4.7)引发了这个异常:
“未知模块中发生了类型为“System.IO.FileNotFoundException”的未处理异常。
无法加载文件或程序集“System.Runtime,Version=4.1.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。”
应用程序配置:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
项目将此行 AutoGenerateBindingRedirects 设置为 true:
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
包.配置:
<packages>
<package id="System.Runtime" version="4.3.0" targetFramework="net47" />
</packages>
我的新网络标准库是 1.6 版本。 它具有 System.Runtime 版本 4.3.0.0。
我已经测试过,但引发了相同的执行:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
我按照链接 [ https://msdn.microsoft.com/en-us/library/2fc472t2 (v=vs.110).aspx]
我不明白为什么最近创建的项目会引发这个异常。 怎么了? 我在使用 Visual Studio 2015 时没有遇到任何问题,但是在 Visual Studio 2017 v15.2 发布后,我浪费了这些错误数小时
谢谢
似乎 Update-Package -reinstall 解决了我的问题。
我不明白为什么每次添加 nuget 引用时都必须运行它......
最有用的评论
似乎 Update-Package -reinstall 解决了我的问题。
我不明白为什么每次添加 nuget 引用时都必须运行它......