问题描述
我有使用 .net 框架 4 编译的外部 .net 库(它的提供程序最近移至 .net 4)我的代码目前在 .net framework 3.5 上运行如何在我的应用程序中使用该外部库?将整个应用程序迁移到 .net 4 需要时间和测试,所以也许将来我会这样做,但现在,有什么可能性?
I have external .net library compiled with .net framework 4 (it's provider moved recently to .net 4) My code currently runs on .net framework 3.5 How to use that external library in my application ? Moving whole application to .net 4 needs time and testing, so maybe in a future i will do that, but now, what are the possibilities ?
推荐答案
没有可能,.NET 3.5自带的CLR版本无法加载4.0程序集.元数据格式已更改.您必须强制您的应用使用 .NET 4.0 CLR 版本.使用 VS2010 重新编译它,以 4.0 为目标,或使用包含 <requestedRuntime>
元素的 .config 文件来请求v4.0".
There are no possibilities, the CLR version that comes with .NET 3.5 cannot load 4.0 assemblies. The metadata format was changed. You have to force your app to use the .NET 4.0 CLR version. Do so by recompiling it with VS2010, targeting 4.0, or by using a .config file that contains the <requestedRuntime>
element to ask for "v4.0".
.NET 4.0 的兼容性非常好.
Compatibility for .NET 4.0 is excellent btw.
这篇关于如何将较高版本的 .net 库 (.dll) 与较低版本的二进制文件集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!