SublimeMSBuild icon indicating copy to clipboard operation
SublimeMSBuild copied to clipboard

Default build fails: 'msbuild' not recognized when only VS 2022 MSBuild is installed

Open dpc00 opened this issue 1 month ago • 0 comments

The default build fails with "'msbuild' is not recognized" on a Visual Studio 2022 install, because the Windows PATH setting does not include the VS MSBuild folder.

Steps (Sublime Text 4, build 4215, Windows 11, MSBuild 1.3.0, Visual Studio 2022 Build Tools with MSBuild 17.14): set up a project file, then run Build with the "MSBuild" build system (default variant).

Result: the console shows 'msbuild' is not recognized as an internal or external command, and the build exits with code 1.

Cause: MSBuild.sublime-build sets "path" to %PATH% plus the .NET Framework v4.0.30319, v3.5 and v2.0.50727 folders only. The msbuild.exe shipped with Visual Studio 2022 is in ...\Microsoft Visual Studio\2022\<edition>\MSBuild\Current\Bin, which the package does not search. With that folder on PATH the Parallel, Debug, Release and default variants all build.

dpc00 avatar Oct 07 '26 01:10 dpc00