c# - "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded"

标签 c# dll .net-4.0 .net-2.0

我收到错误:“此程序集是由比当前加载的运行时更新的运行时构建的,无法加载。”

我有一个 .NET 2.0 项目调用的 .NET 4.0 dll 项目。有没有办法调和框架的差异?

最佳答案

I have a .NET 4.0 dll project that is being called by a .NET 2.0 project. Is there a way to reconcile the difference in framework?

不是那样的,不。 .NET 4 CLR 可以加载 .NET 2 程序集(通常 - 混合模式程序集有一些异常(exception),IIRC),但反之则不行。

您必须将 .NET 2 项目升级到 .NET 4,或者将 .NET 4 项目降级到 .NET 3.5(或更早版本)。

关于c# - "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10607095/

相关文章:

c# - null == null 返回 false?

c# - 是否可以确定麦克风类型?

c# - 是否有必要释放从 C# 接收到的 C++ 字符串的内存?

c# - 检测按钮是被右键单击还是左键单击

c# - 如何在 C# 中解决 Randomize in place 算法?

c++ - 如何准备在单个 Windows 环境中生成 .dll 和 unix .so 的构建作业?

c# - 为什么类库 (dll) 不生成 lib 文件?

.net - .NET 4 中是否有二叉搜索树实现?

c# - 从类构造函数调用抽象方法

java - 在 dll 中使用函数,在 java 中