Closed Shuliyey closed 8 years ago
I believe the problem is here at lib/msbuild-finder.js
var version = constants.MSBUILD_VERSIONS[options.toolsVersion];
if (!version) {
throw new PluginError(constants.PLUGIN_NAME, 'No MSBuild Version was supplied!');
}
var is64Bit = options.architecture === 'x64';
if (version === '12.0' || version === '14.0') {
// On 64-bit systems msbuild is always under the x86 directory. If this
// doesn't exist we are on a 32-bit system. See also:
// https://blogs.msdn.microsoft.com/visualstudio/2013/07/24/msbuild-is-now-part-of-visual-studio/
var env_var_dir = process.env['ProgramFiles(x86)'] || process.env['ProgramFiles'];
var pathRoot = env_var_dir || path.join('C:', is64Bit ? 'Program Files (x86)' : 'Program Files');
var x64_dir = is64Bit ? 'amd64' : '';
return path.join(pathRoot, 'MSBuild', version, 'Bin', x64_dir, 'MSBuild.exe');
}
I believe we should be allowed specify the env_var_dir. Possibly being able to specify it as an option.
Hm shouldn't it help to pass the correct toolsVersion
and VisualStudioVersion
-Property to gulp-msbuild? Like:
gulp_msbuild({
toolsVersion: 14.0,
properties: { VisualStudioVersion: 14.0 },
targets: ["Build"]
});
This should use the MSBuild executable at C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
aah I see i will try again the architecture to be x86
I confused this with Platform property :sweat:
@hoffi it worked :smile: thank you so much, this is embarassing, it was my bad i confused architecture option with the Platform property.
Thanks a lot for the help and open sourcing this great library :smile:
closing this issue, my misunderstanding when using the library
Just adding one note
I have to specify the VisualStudioVersion as a string :smile:
so it will be something like this
gulp_msbuild({
toolsVersion: 14.0,
properties: { VisualStudioVersion: '14.0' },
targets: ["Build"]
});
No problem :)
I don't seem to be able to find the VisualStudioVersion property option for the gulp-msbuild
Basicly my visual studio project is using .Net Framework 4.6, so the old msbuild.exe won't work. I have to use the new msbuild that's located at 'C:\Program Files (x86)\MSBUILD\14.0\Bin\MSBuild.exe'
By using this msbuild tool I can build my project successfully
However I don't seem to be able to build my solution using gulp-msbuild. As I couldn't find a VisualStudioVersion property to pass to the gulp-msbuild module.
I get the below error