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

VS 2022 cannot find path to MSBuild. #32

Open
NoelAbrahams opened this issue Jan 10, 2022 · 3 comments
Open

VS 2022 cannot find path to MSBuild. #32

NoelAbrahams opened this issue Jan 10, 2022 · 3 comments

Comments

@NoelAbrahams
Copy link

NoelAbrahams commented Jan 10, 2022

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.

@jhaker
Copy link
Owner

jhaker commented Jan 24, 2022

Resolved in commit 6fb5d83. "Add log to file for improved troubleshooting. Add support for env build path."

See readme for an alternative way to set build paths using the environment variable "MsbuildPath".

@jhaker jhaker closed this as completed Jan 24, 2022
@NoelAbrahams
Copy link
Author

Not sure why this was closed or what has been fixed.

The path is currently resolving to non-existent file C:\Windows\microsoft.net\Framework\v17.0\msbuild.exe.

@jhaker
Copy link
Owner

jhaker commented Feb 25, 2022

Support for a better dotnet framework locator is needed. I am open to pull requests if anyone would like to extend the current detection code. Or if anyone knows of an npm package that locates dotnet build paths I would be happy to take a look and integrate if it works.

For now, I have included two ways to override build paths. Please see readme for examples.

@jhaker jhaker reopened this Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants