Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hardcode the path to v141 platform toolset #3434

Merged
merged 27 commits into from
Oct 18, 2019
Merged
17 changes: 13 additions & 4 deletions vnext/local-cli/runWindows/utils/msbuildtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
// @ts-check
'use strict';

const EOL = require('os').EOL;
const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -65,11 +64,21 @@ class MSBuildTools {

// Set platform toolset for VS 2019
if (this.version === '16.0') {
const results =
child_process
.execSync(
'"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" -requires Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 -property installationPath',
)
.toString()
.split(EOL)[0] + '\\MSBuild\\Microsoft\\VC\\v150\\';
JunielKatarn marked this conversation as resolved.
Show resolved Hide resolved

console.warn('v141Path = ' + results);
asklar marked this conversation as resolved.
Show resolved Hide resolved

args.push('/p:PlatformToolset=v141');
args.push('/p:VisualStudioVersion=16.0');
args.push(
'/p:VCTargetsPath=C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Microsoft\\VC\\v150\\',
);
args.push('/p:VCTargetsPath=' + results);

console.warn(args.join(' '));
}

if (config) {
Expand Down