hoffi / gulp-msbuild

gulp-msbuild has moved to https://github.com/fluffynuts/gulp-msbuild.
MIT License
53 stars 44 forks source link

`toolsVersion: 15.0` fails to find msbuild, after looking in amd64 folder #55

Closed AArnott closed 7 years ago

AArnott commented 7 years ago

In a VS 2017 developer command prompt, I can't get gulp-MSBuild util to find MSBuild.exe. It's on my PATH, but evidently the gulp task doesn't leverage that. My path is:

C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\bin\MSBuild.exe

I know VS2017 provides a way to find this tool, even if it isn't on the PATH, ideally gulp-MSBuild would use that to find it rather than just checking a few common paths. But short of that, what option can I set to specify the path myself?

AArnott commented 7 years ago

The tool for finding VS2017 properly is documented here:

https://blogs.msdn.microsoft.com/heaths/2017/04/21/vswhere-is-now-installed-with-visual-studio-2017/

AArnott commented 7 years ago

It looks like this command would probably be what you want for a toolsversion:15 setting:

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -format json -latest -version "[15.0,16.0)"

Do you want me to send a PR?

hoffi commented 7 years ago

Hey, feel free to submit a PR. The current logic could still be kept as fallback.

hoffi commented 7 years ago

Fixed with #60