gpt4 book ai didi

找不到 MSBuild.exe,cmd.exe

转载 作者:行者123 更新时间:2023-12-04 15:02:29 30 4
gpt4 key购买 nike

我最近安装了 Visual Studio 2017,MSBuild.exe 不是应该自带的吗? bash 脚本之一正在调用它,但找不到任何东西。

这是 build.bat 产生错误的部分(您可以看到整个文件 here )

MSBuild.exe mpc-hc.sln %MSBUILD_SWITCHES%^
/target:%BUILDTYPE% /property:Configuration="%BUILDCFG% Filter";Platform=%1^
/flp1:LogFile=%LOG_DIR%\filters_errors_%BUILDCFG%_%1.log;errorsonly;Verbosity=diagnostic^
/flp2:LogFile=%LOG_DIR%\filters_warnings_%BUILDCFG%_%1.log;warningsonly;Verbosity=diagnostic
IF %ERRORLEVEL% NEQ 0 (
CALL "%COMMON%" :SubMsg "ERROR" "mpc-hc.sln %BUILDCFG% Filter %1 - Compilation failed!"
EXIT /B
) ELSE (
CALL "%COMMON%" :SubMsg "INFO" "mpc-hc.sln %BUILDCFG% Filter %1 compiled successfully"
)

最佳答案

您可以使用 vswhere 1 随附 Visual Studio 2017 .
它位于"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" .

MSBuild.exe的路径部分然后由 vswhere -nologo -latest -property installationPath 检索,这会导致例如 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community .
根据您要使用的 msbuild 版本,您现在可以猜测路径的其余部分:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\版本\Bin\MSBuild.exe

哪里版本例如,15.0版本 installationVersion: 15.3.26730.12"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationVersion 输出.

1 见 GitHub

关于找不到 MSBuild.exe,cmd.exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46223916/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com