Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Command Line with Framework 2.0

Before, I was using VS 2008 command prompt and when I do

clrver

I got

Versions installed on the machine:
v1.1.4322
v2.0.50727

Now with Visual Studio 2010 command prompt I get :

Versions installed on the machine:
v1.1.4322
v2.0.50727
v4.0.30319

I want to know if there is a way to compile my C# code with the VS 2010 command line using the Framework 2.0 and not 4.0

-- Edit --

Is there another way than going in the properties of the project?

like image 816
LolCat Avatar asked Sep 23 '26 17:09

LolCat


2 Answers

Use MSBuild command line and pass the ToolsVersion (2.0,3.0,3.5,4.0) and TargetFrameworkVersion (v2.0,v3.0,v3.5,v4.0) properties:

msbuild your.sln /p:TargetFrameworkVersion=v2.0;ToolsVersion=3.5

The UI option is described here.

like image 172
KMoraz Avatar answered Sep 25 '26 08:09

KMoraz


You can change the targeted framework in your project settings.

http://msdn.microsoft.com/en-us/library/bb398202.aspx

(I do not yet have VS 2010 on my work machine, so I can't test whether or not support extends to .NET 2.0, though I believe it does)

like image 45
JDB Avatar answered Sep 25 '26 08:09

JDB