如何将高版本的.net库(.dll)与低版本的二进制文件进行整合 [英] how to integrate .net library (.dll) from higher version with binaries from lower version

查看:115
本文介绍了如何将高版本的.net库(.dll)与低版本的二进制文件进行整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用.net framework 4编译的外部.net库(最近它被移动到.net 4)
我的代码当前运行在.net framework 3.5
如何在我的外部库中使用该外部库申请?
将整个应用程序移动到.net 4需要时间和测试,所以也许将来我会这样做,但现在有什么可能?

解决方案

没有任何可能性,.NET 3.5附带的CLR版本无法加载4.0程序集。元数据格式已更改。您 强制您的应用程序使用.NET 4.0 CLR版本。通过使用VS2010重新编译它,目标为4.0,或使用包含< requestedRuntime> 元素的.config文件来请求v4.0 p>

.NET 4.0的兼容性非常好。

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 ?

解决方案

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".

Compatibility for .NET 4.0 is excellent btw.

这篇关于如何将高版本的.net库(.dll)与低版本的二进制文件进行整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆