在 Visual Studio 2008 中同时构建多个解决方案的最简单方法
有没有一种简单直接的方法可以批量构建多个 VS2008 解决方案?我想一次构建超过 50 个作为发布版本,也许也作为调试版本。
仅在命令行上使用 MSBuild 的问题在于,很难找出哪些解决方案/项目无法构建,而这些信息至关重要。有人有好的建议吗?
Is there a simple and straightforward way to build many VS2008 solutions in a batch? I would like to build over 50 at once as Release, and perhaps also as Debug builds.
The trouble with just using MSBuild on the command line is that it is very difficult to find out which solutions/projects failed to build, information which is essential. Does anyone have a good suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 MSBuild 脚本构建所有解决方案,并为仅错误或警告或完整诊断日志指定不同的日志文件。您最多可以使用十个文件记录器。
定义用于构建解决方案的 MSBuild 脚本。将所有解决方案文件添加到 ProjectToBuild 项集合中:
使用 /flp MSBuild 命令行参数 为错误、警告和完整诊断日志指定不同的日志文件。
You can build all solutions using MSBuild script and specify different log files for errors or warnings only or full diagnostic log. You can use up to ten file loggers.
Define MSBuild script for building your solutions. Add all your solution files in ProjectToBuild item collection:
Use /flp MSBuild command line argument to specify different log files for errors, warning, and full diagnostic log.
您可以从批处理文件中调用 devenv (Visual Studio) 来构建您的项目,例如:
这将安静地运行,而不显示 IDE。日志文件将接收您通常在 VS-IDE 构建的输出窗口中看到的消息。
如果构建正常,则返回码为 0,否则为 1。
这里是所有 devenv 命令行开关的列表
You can call devenv (Visual Studio) from a batch file to build your project, for instance:
This will run quietly without showing the IDE. The logfile will receive the messages you normally see in the output window building from within the VS-IDE.
Returncode is 0 if the build is ok, otherwise 1.
Here is a list of all devenv command line switches
您可以为批处理文件中的每个解决方案调用 MSBuild,将输出重定向到文件,以便您可以看到失败的内容。
You can call MSBuild for each solution in a batch file, redirecting the output to a file, so you can see what failed.