使用 msbuild 构建解决方案文件 [英] Building a solution file using msbuild

查看:32
本文介绍了使用 msbuild 构建解决方案文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正要使用 msbuild 构建一个 Visual Studio 解决方案文件.我使用以下命令行来构建解决方案

I was about to build a Visual Studio solution file using msbuild. I used the following commandline for building the solution

msbuild.exe SolutionFile.sln /t:Build/p:Configuration=Release;Platform=Win32

即使构建在某个时间点开始,构建看起来挂起并且无法向前推进,如下所示

Even though the build starts at some point the build is looking hang and fails to move forward as shown below

Done Building Project "D:SolutionPathProjectFile10.vcxproj" (default targets).

SolutionFile.sln下有很多.proj,这些都是我要构建的.

There are a lot of .proj under SolutionFile.sln those I have to build.

我必须使用 msbuild.exe 而不是 devenv.com

I have to use msbuild.exe rather than devenv.com

推荐答案

有一种技术可以诊断 msbuild 内部发生的事情,它可以帮助您找出这里发生的事情.从命令提示符设置环境变量:

There's a technique for diagnosing what's happening inside msbuild which may help you work out what's happening here. From a command prompt set an environment variable:

set msbuildemitsolution=1

运行 msbuild 后,这将生成一个 .metaproj 文件.此文件是 msbuild 内部使用的文件,但随后会被删除.您可以阅读它以找出实际目标的名称.Build 目标被扩展以显示它实际调用的内容.然后,您可以尝试使用 msbuild 的 /t 标志构建单个目标,以找出导致问题的目标.

Once you have run msbuild then this will generate a .metaproj file. This file is what msbuild uses internally but then deletes. You can read it to find out the name of the actual targets are. The Build target is expanded to show what it actually calls. You can then try building the individual targets with the /t flag of msbuild to work out which target is causing the problem.

这篇关于使用 msbuild 构建解决方案文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆