Go How does I run MSBuild from the command line using Windows SDK 7.1?

Source: Internet
Author: User



This article turns from; http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1






Q:



I ' m setting up. NET 4.0 support on our CI server. I ' ve installed. NET 4.0, and the. NET tools from the Windows 7.1 SDK.



On. NET 2.0 and 3.5, that just worked. With. NET 4, when I run the ' Windows SDK 7.1 Command Prompt ' from the Start menu, it complains about


The x86 compilers are not currently installed. x86-x86
Please go to Add/Remove Programs to update your installation.
.
Setting SDK environment relative to C:\Program Files\Microsoft
SDKs\Windows\v7.1
\.
Targeting Windows Server 2008 x86 Debug


Then if I try to run MSBuild, I get:


C:\Program Files\Microsoft SDKs\Windows\v7.1>msbuild
‘msbuild‘ is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft SDKs\Windows\v7.1>


I can ' t quite believe that installing the runtime and SDK would leave you with a system that can ' t run MSBuild ... have I mi ssed some obvious step or obscure Windows Update, or is time to give up and start hacking the system path?









A1:


173down VoteAccepted

To enablemsbuildCommand Prompt, you simply has the to add the path to the. NET 4 Framework for install on your Machin E to thePATHenvironment variable.

You can access the environment variables by:

  1. Right clicking on computer
  2. Click Properties
  3. Then click Advanced System Settings on the left navigation bar
  4. On the next dialog box click Environment Variables
  5. Scroll down toPATH
  6. Edit it to include your path to the framework (don ' t forget a ";," after the last entry.).

For reference, my path isC:\Windows\Microsoft.NET\Framework\v4.0.30319.





A2:



FromVisual Studio 2013onwards,MSbuildcomes as a part of Visual Studio. Earlier, MSBuild is installed as a part of. NET Framework.



MSBuild is installed directly under %ProgramFiles%. So, the path for MSBuild might is different depending on the version of Visual Studio.



Visual Studio 2015for, Path of isMSBuild"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"



Visual Studio 15 Previewfor, Path of isMSBuild"%ProgramFiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe"



Also, Some new MSBuild properties has been added and Some having been modified. For more information



Update 1:vs 2017



The location for the MSBuild have changed again with the release of Visual Studio. Now the installation directory is under the%ProgramFiles(x86)%\Microsoft Visual Studio\2017\[VS Edition]\15.0\Bin\. Since, I have a Enterprise edition, the MSBuild location for my machine is






Go How does I run MSBuild from the command line using Windows SDK 7.1?


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.