Work around msbuild bug that blocks git tool tasks in VS2017 prompt

This commit is contained in:
Nick Guerrera 2016-12-13 16:10:39 -08:00
parent 148351c12d
commit 9cf2d74c8b
2 changed files with 8 additions and 2 deletions

View file

@ -3,6 +3,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Cli.Build
{
@ -92,7 +93,9 @@ namespace Microsoft.DotNet.Cli.Build
protected override string GenerateFullPathToTool()
{
return "git";
// Workaround: https://github.com/Microsoft/msbuild/issues/1215
// There's a "git" folder on the PATH in VS 2017 Developer command prompt and it causes msbuild to fail to execute git.
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "git.exe" : "git";
}
protected override string GenerateCommandLineCommands()

View file

@ -3,6 +3,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Cli.Build
{
@ -26,7 +27,9 @@ namespace Microsoft.DotNet.Cli.Build
protected override string GenerateFullPathToTool()
{
return "git";
// Workaround: https://github.com/Microsoft/msbuild/issues/1215
// There's a "git" folder on the PATH in VS 2017 Developer command prompt and it causes msbuild to fail to execute git.
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "git.exe" : "git";
}
protected override string GenerateCommandLineCommands()