You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过命令行批量构建.NET解决方案并获取项目构建统计?

Visual Studio解决方案命令行构建问题

我的Visual Studio解决方案包含40多个项目,每个项目有Debug/Release两种配置,以及Win32/x64/Any CPU三种平台,总计约200种配置组合。我已通过Visual Studio全选批量构建成功,输出为:

========== Build: 200 succeeded, 0 failed, 60 up-to-date, 16 skipped ==========
========== Build started at 7:01 PM and took 14:01.354 minutes ==========

尝试的构建方案

方案1

@echo off
cls
msbuild.exe "solutionpath\solutionfile.sln" 
pause

方案2

@echo off
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Debug /p:Platform="Any CPU"
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Debug /p:Platform="x64"
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Debug /p:Platform="Win32"
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Release /p:Platform="Any CPU"
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Release /p:Platform="x64"
msbuild.exe "solutionpath\solutionfile.sln" /p:Configuration=Release /p:Platform="Win32"
pause

咨询问题

  • 方案2是否覆盖了Visual Studio全选批量构建的所有配置与平台?
  • 如何获取命令行构建的项目统计数据,以便与Visual Studio输出对比?

内容的提问来源于stack exchange,提问作者ChinnaR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 14:35:23