如何在VS2010中创建.NET2兼容的应用程序?
我正在使用 Microsoft Visual Studio 2010 和 .NET4,但我想创建也可以在 .NET2 中运行的应用程序(Windows 窗体应用程序)。原因是我希望它非常易于使用并且可以在许多机器上移植,但并不是每个人都安装了 .NET4。
我可以这样做还是需要安装旧版本的 Visual Studio?那么哪个版本最适合大多数可移植的 .NET 应用程序。
I'm using Microsoft Visual Studio 2010 and .NET4, but I would like to create application(Windows Form Application) that can be also run in .NET2. The reason is that I want it to be very easy to use and portable across many machines and not everybody has .NET4 installed.
Can I do it or do I need to install older version of Visual Studio? Is so what version is the best for most portable .NET app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以在项目的属性中修改目标框架:
You can modify the target framework in the properties of the project:
创建新项目时,您可以选择要定位的 .NET Framework 版本。如果您想更改现有项目的框架,请按照达林的说明进行操作。
You can select which .NET Framework version you want to target when you create a new project. If you want to change the framework of an existing project, do what Darin has illustrated.
只需通过查看您正在处理的解决方案的属性来修改目标框架即可。
我强烈建议您根据 .NET 2.0 的年龄来定位 .NET 3.5。
.NET Framework 2.0 附加到 Visual Studio 2005。
Just modify the target framework by looking at the propeties of the solution you are working on.
I would highly advise you to target .NET 3.5 just based on the age of .NET 2.0.
.NET Framework 2.0 was attached to Visual Studio 2005.
通过修改目标框架是一种方法,但如果您正在考虑可移植性,也许您需要的是某种适用于每个和/或大多数 Windows 版本的本机代码。
By modifying the target framework is the way, but if you are thinking of portable maybe what you need is some kind of native code that works in every and/or most windows version.
不要忘记从命名空间列表中删除多余的命名空间。例如 LINQ...
Don't forget to delete redundant namespaces from your namespace list. For example LINQ...