Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:54:43+00:00 2026-06-09T21:54:43+00:00

I want to build a c# project(.csproj) from commandline using msbuild and want to

  • 0

I want to build a c# project(.csproj) from commandline using msbuild and want to target .Net2.0 runtime.

I see that the project xml file has 2 tags of interest

<Project ToolsVersion="4.0" ... 

and

<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

I was wondering if

  • Can ToolsVersion 4.0 produce compatible code for .Net2.0 runtime?
  • Can I override the target framework tag from the project file via the command line (does the /ToolsVersion command line switch achieve this?

I specifically want to achieve this via command line and not modify the project file.

Currently I am doing something like this

msbuild myproj.csproj /p:Configuration=Release
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:54:44+00:00Added an answer on June 9, 2026 at 9:54 pm

    You need the commandline arguments for msbuild to make that work:

    msbuild.exe MyProj.proj /p:TargetFrameworkVersion=v2.0;Configuration=Release /tv:3.5
    

    therfore overriding the value in the proj file aswell as the ToolsVersion.

    To find out which msbuild version default is used, start a Visual Studio Command prompt ( found in the Start menu > Microsoft Visual studio 2010 > Visual Studio Tools) and type msbuild.
    The first line of the output will hold your BuidEngineversion:

    Microsoft (R) Build Engine Version 4.0.30319.1

    From the msdn doc:

    MSBuild uses a tool set of tasks, targets, and tools to build an
    application. Typically, a MSBuild tool set includes a
    microsoft.common.tasks file, a microsoft.common.targets file, and
    compilers such as csc.exe and vbc.exe. Most tool sets can be used to
    compile applications to more than one version of the .NET Framework
    and more than one system platform

    You could also check the Environment vars for a version of the framework installed:
    set F from the Visual Studio Command prompt gives me this result:

    Framework35Version=v3.5
    FrameworkDir=c:\Windows\Microsoft.NET\Framework\
    FrameworkDIR32=c:\Windows\Microsoft.NET\Framework\
    FrameworkVersion=v4.0.30319
    FrameworkVersion32=v4.0.30319

    ToolSet Explanation
    ToolSetVersion

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website project that I want to build using CruiseControl.net. On one
I got this error when I want to build project that is using Qt4iOS
I see that a feature I want to build from HEAD (to get the
I am using boost build in my project and now i want to use
I want to pack the project into a zip-file and have the build date
I want to build a project using codeigniter, the project consist of 2 levels,
Some of my .csproj project files have special target AssembleJS that merges all .js
i want to build my android project with ndk so i created my make
I'm working on a project which I want to build up OO. Now I
I create an Android project for build my custom widget, and I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.