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:
- Right clicking on computer
- Click Properties
- Then click Advanced System Settings on the left navigation bar
- On the next dialog box click Environment Variables
- Scroll down toPATH
- 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?