92

How do you get msbuild.exe without installing those crazy Visual Studio programs?

I need it for an npm install to finish working. I'm on Windows 7 and can't get on older version of Visual Studio 2013 Express online.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
SuperUberDuper
  • 9,242
  • 9
  • 39
  • 72
  • 2
    It comes with the .NET framework as far as I know. Otherwise just the Windows SDK will be needed. – leppie Aug 26 '14 at 12:50
  • 5
    @leppie As of VS 2013, [it is no longer part of the .NET Framework](http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx). The older versions are still included with the framework. – Mike Zboray Aug 26 '14 at 16:16
  • Related post - [How can I install the VS2017 version of msbuild on a build server without installing the IDE?](https://stackoverflow.com/q/42696948/465053) – RBT Mar 04 '20 at 11:49

4 Answers4

149

The latest (as of Jan 2019) stand-alone MSBuild installers can be found here: https://www.visualstudio.com/downloads/

Scroll down to "Tools for Visual Studio 2019" and choose "Build Tools for Visual Studio 2019" (despite the name, it's for users who don't want the full IDE)

See this question for additional information.

John Weldon
  • 39,849
  • 11
  • 94
  • 127
  • 27
    It took a while to find where `MSBuild.exe` was installed. By default, it is here: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin` – Nikola M. Nov 27 '17 at 10:13
  • 2
    See, for example, [this question](https://stackoverflow.com/q/42696948/1364007) which goes into some detail about how to just install the Visual Studio 2017 Build Tools (and not the IDE too). – Wai Ha Lee Aug 02 '18 at 15:17
  • 6
    The tool is now listed under `Tools for Visual Studio 2017` instead of the `Other Tools and Framework` section. – Frank Liu Sep 17 '18 at 07:50
  • 6
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin - is the location today – ValGe Apr 18 '20 at 07:21
  • In Visual Studio 2022, the tool is installed in: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin` – Erel Segal-Halevi Jan 31 '22 at 08:49
22

It used to be installed with the .NET framework. MsBuild v12.0 (2013) is now bundled as a stand-alone utility and has it's own installer.

http://www.microsoft.com/en-us/download/confirmation.aspx?id=40760

To reference the location of MsBuild.exe from within an MsBuild script, use the default $(MsBuildToolsPath) property.

Vadzim
  • 24,954
  • 11
  • 143
  • 151
Nicodemeus
  • 4,005
  • 20
  • 23
  • 1
    but this version is obsolete (now). how do I get v15? – Gabriel Jul 03 '18 at 07:21
  • 1
    @Rigel I don't know if you specifically want VS2015's build tools, but [this question](https://stackoverflow.com/q/42696948/1364007) goes into some detail about getting the 2017 tools. – Wai Ha Lee Aug 02 '18 at 15:19
4

You can also get the MSBuild executable as a Nuget package https://www.nuget.org/packages/Microsoft.Build.Runtime/.

cdiggins
  • 17,602
  • 7
  • 105
  • 102
0

Download MSBuild with the link from @Nicodemeus answer was OK, yet the installation was broken until I've added these keys into a register:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\12.0]
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\\Microsoft.Cpp\\v4.0\\V110\\'))"
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\\Microsoft.Cpp\\v4.0\\V110\\'))" 
Alexander Vasiljev
  • 1,974
  • 3
  • 19
  • 27