Skip to content

VS 2022 cannot find path to MSBuild. #32

@NoelAbrahams

Description

@NoelAbrahams

Hi

Used version: 1.1.4

The logic for getting the path to MSBuild.exe is failing for the following reason:

  • When using msbuild.config('version', '17.0');
  • VS 2022 is installed under 'Program Files'.
  • The location of MSBuild is here: C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe
  • Node process.env['ProgramFiles'] gives 'C:\Program Files (x86)'

Debugging is really hard because errors are being logged to console, which is not visible when invoked outside of the command line.

if(msbuildDir === undefined){
console.log('** Could not find VS IDE / tools install folder. Please install at least the VS Build Tools in the "programFiles" dir. **');
}

Also after this error, the code just carries on without terminating causing the whole process to crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions