针对多个版本的.NET Framework [英] Targeting multiple versions of .net framework

查看:191
本文介绍了针对多个版本的.NET Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一些code,将在理论上,对编制的任意的版本的.NET Framework。想想的Hello World,如果你喜欢。

Suppose I have some code that would, in theory, compile against any version of the .net framework. Think "Hello World", if you like.

如果我实际编译code,不过,我会得到一个运行违心的尤其的版本的可执行文件。

If I actually compile the code, though, I'll get an executable that runs against one particular version.

有没有什么办法来安排的事情,这样的编译的exe只是反对任何版本发现运行?我强烈怀疑,答案是否定的,但我很乐意被证明是错误的......

Is there any way to arrange things so that the compiled exe will just run against whatever version it finds? I strongly suspect that the answer is no, but I'd be happy to be proven wrong...


编辑:好吧,我去我们的楼梯口。我不知道,后来框架将愉快地运行在早期版本编译的exe。感谢所有的答复!

Well, I'll go to the foot of our stairs. I had no idea that later frameworks would happily run exe's compiled under earlier versions. Thanks for all the responses!

推荐答案

林不知道这是否是正确的,但我想尝试编译它的最低版本,更高版本应该可以运行低版本的exe文件的

Im not sure if this is correct, but i'd try to compile it for the lowest version, the higher versions should be able to run the lower versions exe's.

这篇关于针对多个版本的.NET Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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