Where is MSBuild.exe installed in Windows when installed using BuildTools_Full.exe?

.NetMsbuildWindows Server

.Net Problem Overview


I'm trying to set up a build server for .NET, but can't figure out where MSBuild.exe is installed.

I'm trying to install MSBuild using the Microsoft Build Tools 2013: https://www.microsoft.com/en-us/download/details.aspx?id=40760

.Net Solutions


Solution 1 - .Net

As per https://docs.microsoft.com/en-us/visualstudio/msbuild/what-s-new-in-msbuild-15-0

> MSBuild is now installed in a folder under each version of Visual Studio. For example, C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild. You can also use the following PowerShell module to locate MSBuild: vssetup.powershell. > >MSBuild is no longer installed in the Global Assembly Cache. To reference MSBuild programmatically, use NuGet packages.

Solution 2 - .Net

MSBuild in the previous versions of .NET Framework was installed with it but, they decided to install it with Visual Studio or with the package BuildTools_Full.exe.

The path to MSBuild when installed with the .NET framework:

> C:\Windows\Microsoft.NET\Framework[64 or empty][framework_version]

The path to MSBuild when installed with Visual Studio is:

> C:\Program Files (x86)\MSBuild[version]\Bin for x86

and

> C:\Program Files (x86)\MSBuild[version]\Bin\amd64 for x64.

The path when BuildTools_Full.exe is installed is the same as when MSBuild is installed with Visual Studio.

Solution 3 - .Net

Open the Microsoft command line. I'm using Visual Studio 2019, so my command line is "Developer Command Prompt for VS 2019".

Then run the command:

where msbuild

And the path will be echo'd.

Solution 4 - .Net

You can find the VS2019 here : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe

Solution 5 - .Net

This worked for me (this searches msbuild.exe in c:\ - the default didn't work)

where /R c:\ msbuild.exe

Solution 6 - .Net

For MsBuild 17:

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin

For MsBuild 16:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin

For MsBuild 15:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild (or replace 'Enterprise' with 'Professional' or 'Community')

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjonasmView Question on Stackoverflow
Solution 1 - .NetAniket ThakurView Answer on Stackoverflow
Solution 2 - .NetMaGnumXView Answer on Stackoverflow
Solution 3 - .NetEv.View Answer on Stackoverflow
Solution 4 - .NetKarvanView Answer on Stackoverflow
Solution 5 - .NetthewpfguyView Answer on Stackoverflow
Solution 6 - .NetRocklanView Answer on Stackoverflow