在使用.Net2.0构建的应用程序上使用需要.Net4.0的Dll [英] Using Dll that require .Net4.0 on app built with .Net2.0

查看:333
本文介绍了在使用.Net2.0构建的应用程序上使用需要.Net4.0的Dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想知道,如果有任何解决方案允许我使用需要.Net4.0或更高版本的DLL来使用我必须用.Net2.0制作的应用程序。



任何解决方案请。

谢谢

Hi

I want to know please, If there is any solution that allow me to Use a DLL that require .Net4.0 or higher to be used with application that i have to made with .Net2.0 .

Any solution Please.
thank's

推荐答案

没有。问题是.NET应用程序指定 - 并检查 - 它们在加载时需要的.NET版本,这意味着如果您引用了更高版本的程序集,那么当您尝试运行它时,它将无法使用正确的框架。 br />
这就是为什么VS在你尝试添加一个以后的程序集作为参考时抱怨的原因。
你唯一的选择是将主应用程序的级别提高到等于或高于DLL,或重新编译DLL以使用较低的.NET版本。
No. The problem is that .NET apps specify - and check - the .NET version they need at load time, and this means that if you referenced a later version assembly it wouldn't have the right framework available when you tried to run it.
That's why VS complains when you try to add a later assembly as a reference.
Your only option is to raise the level of your main app to equal or above that of the DLL, or recompile the DLL to use a lower .NET version.


答案为否。

.Net框架(v2.0或更高版本)不转发兼容。



令人惊讶的是,我得到了以下链接。您可以查看它

如何从基于.NET 2的应用程序使用基于.NET 4的DLL? | Arik Poznanski'博客 [ ^ ]


这篇关于在使用.Net2.0构建的应用程序上使用需要.Net4.0的Dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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