From f4cf1c4b436a1c5249752ce876d3f4d11e8285dd Mon Sep 17 00:00:00 2001 From: "Eduardo Antunes C. de Sousa" Date: Wed, 28 Jan 2015 21:58:07 -0200 Subject: [PATCH] Try to use MSBuild from VS2013, instead of MSBuild from .NET 4.0 --- OmniSharp/Build/BuildCommandBuilder.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OmniSharp/Build/BuildCommandBuilder.cs b/OmniSharp/Build/BuildCommandBuilder.cs index a7cca85..4e5ce6f 100644 --- a/OmniSharp/Build/BuildCommandBuilder.cs +++ b/OmniSharp/Build/BuildCommandBuilder.cs @@ -1,6 +1,7 @@ using System.IO; using OmniSharp.Solution; using OmniSharp.Configuration; +using Microsoft.Win32; namespace OmniSharp.Build { @@ -23,9 +24,11 @@ public string Executable { return PlatformService.IsUnix ? "xbuild" - : Path.Combine( - _config.MSBuildPath ?? System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), - "Msbuild.exe"); + : string.Format("\"{0}\"", Path.Combine( + _config.MSBuildPath ?? + Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0", "MSBuildToolsPath", null) as string ?? + System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), + "Msbuild.exe")); } }