Tom Riley
Tom Riley

Reputation: 1722

msbuild.exe location on windows 8 with VS2012

I'm trying to set up a Jenkins CI server to deploy a .NET 4.5 app but I cant for the life of me find the msbuild exe on my windows 8 machine running visual studio 2012. Any ideas?

Upvotes: 13

Views: 16641

Answers (3)

Stas BZ
Stas BZ

Reputation: 1192

I do not like neither of the other answers. Because in C:\Windows\Microsoft.NET\Framework\ or registry you cannot find new msbuild version that was installed with visual studio or separately as build tools. The best way is to use vswhere find msbuild

Upvotes: 0

Rhys Bevilaqua
Rhys Bevilaqua

Reputation: 2167

The correct way to locate MSBuild is to use the registry.

Here's a powershell implementation of finding a specific version of the .exe

$regKey = "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\${Version}"
$itemProperty = Get-ItemProperty $RegKey -ErrorAction SilentlyContinue
if ($itemProperty -ne $null -and $itemProperty.MSBuildToolsPath -ne $null)
{
     $msBuildPath = Join-Path $itemProperty.MSBuildToolsPath -ChildPath "MsBuild.exe"
}

Upvotes: 1

Manu Mohan
Manu Mohan

Reputation: 252

Make sure that you have installed the corresponding .Net framework. You can find the build.exe by following this sample path

C:\Windows\Microsoft.NET\Framework\v4.5\MSBuild.exe

Upvotes: 18

Related Questions