c# - System.Runtime,版本=4.1.0.0 例外
问题描述
在我的控制台 C# 应用程序中,我有以下几行:
ServerManager sm = new ServerManager();
SiteCollection sc = sm.Sites;
Microsoft.Web.Administration
我根据需要添加了引用 。但我得到了例外:
无法加载文件或程序集 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。该系统找不到指定的文件。
解决方案
尝试修改 app.config 条目以匹配新版本的 packages.config,如下所示。
您必须检查 packages.config 以了解确切版本
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b0123f7facd50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.6.0" />
</dependentAssembly>
推荐阅读
- spring-boot - 如何在gradle中从一个位置复制到另一个位置时即时修改文件
- reactjs - 如何跟踪用户喜欢的帖子?
- php - Laravel - 无法访问关系
- c++ - 它 - vector.begin() 实际上是做什么的?
- java - 在Java文件夹中递归查找文件/目录
- python - Combobox Tkinter 填充数据库值
- boost - 如何将 boost::multiprecision::cpp_int 从大端更改为小端
- matlab - 如何在 MATLAB 中以原始质量保存带有新绘制线条的图像
- c++ - 使用模板方法模拟类
- java - 具有多租户的单元测试 Grails 域类