How to choose .NET version to compile project?

2019-06-17 03:01发布

I have VS2005. How can I compile my project under specific version of .NET? I have installed 1.0, 2.0, 3.0 & 3.5. Tnx in advance.

7条回答
贪生不怕死
2楼-- · 2019-06-17 03:24

I think you can do that if you use the SharpDevelop IDE, which is free, and really similar to Visual Studio. http://www.icsharpcode.net/OpenSource/SD

查看更多
\"骚年 ilove
3楼-- · 2019-06-17 03:32

VS2005 has no support for 1.0,1.1 and 3.5, you only would be able to compile from 2.0 up to 3.0. 3.0 are only new libraries added to 2.0 so you only have to add the references.

查看更多
神经病院院长
4楼-- · 2019-06-17 03:38

Visual 2008 allow you to choose a specific version of the framework in the project properties.

In Visual 2005, by default, projects use v2.0 but you can build 3.5 projects to using templates (WPF application, WCF, ....)

查看更多
The star\"
5楼-- · 2019-06-17 03:40

You can't I'm afraid. VS2005 only works with .NET framework 2.0. You'll need the appropriate versions of Visual Studio to work with other versions:

  • 1.0: Visual Studio .NET
  • 1.1: Visual Studio .NET 2003
  • 2.0: Visual Studio 2005 / 2008
  • 3.0 / 3.5: Visual Studio 2008
  • 4.0: Visual Studio 2010

jmservera points out that some 3.0 libraries are compatible with Visual Studio 2005. For example WCF is compatible, while LINQ isn't. Some of these require additional downloads, for example to use Windows Workflow Foundation comfortably in Visual Studio 2005, you need to install this extension.

查看更多
放荡不羁爱自由
6楼-- · 2019-06-17 03:41

This is just for your information: If you are using VS version greater than or eqaul to 2008, you can do this by right clicking the project you want to build, click Properties, and select the Application tab (if not already selected). Change the value in the Target Framework dropdown list.

Target Framework
(source: scottgu.com)

查看更多
Bombasti
7楼-- · 2019-06-17 03:47

I believe it is possible with MSBuild:

http://social.msdn.microsoft.com/forums/en-US/msbuild/thread/6043542c-6946-488c-b5f4-960eaed7a9f4/

On a side note, I use VS 2008 and when I view the Properties for a project, I get the option to build for 3 different target frameworks: .NET 2.0, 3.0 and 3.5

查看更多
登录 后发表回答