【发布时间】:2019-03-01 18:03:22
【问题描述】:
当我尝试在命令行上使用 MSBuild 编译 c++ 解决方案时
1 - 默认情况下它不会选择活动配置
2 - 当我强制它(调试/Win32)时,它说它不存在
3 - 如果我尝试不同的 Release/Win32 组合,也会出现同样的问题
c:\myproject>"P:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild".exe game2D_sdl.sln /p:useenv=true /m /t:rebuild /p:Configuration=Debug /p:Platform=Win32
...
1>c:\myproject\game2D_sdl.sln.metaproj : error MSB4126: The specified solution configuration "Debug|Win32" is invalid. Please specify a valid solution configuration using the Configura
tion and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [Z:\WORK\SD
L\game2D_sdl\game2D_sdl.sln]
我错过了什么?
问候
【问题讨论】:
-
您的屏幕截图显示的是项目配置而不是解决方案配置,请参阅主窗口工具栏中的下拉菜单
-
msbuild game2D_sdl.sln /p:useenv=true /m /t:rebuild /p:Configuration=Debug /p:Platform=X86 可以工作吗?
标签: c++ visual-studio command-line msbuild