2012-03-02 62 views

回答

3

的MSBuild(为Visual Studio构建引擎)使用,其中用于诉讼的工具(一个或多个)由项目文件正在兴建支配的模型。因此,您的工具列表将根据您正在构建的项目类型而有所不同。找出用于构建任何给定解决方案的工具列表的最简单方法是通过工具 - >选项 - >项目打开MSBuild更详细的日志记录级别(详细信息或诊断信息)&解决方案 - >构建&在Visual Studio中运行,然后解析/调查构建输出以指示构建目标当前调用的工具。

+0

+1表示工具类型不同。 – 2012-03-06 08:23:37

+0

谢谢!我试图看到详细的输出。但是我看到:任务“Csc” 完成执行任务“Csc”。但它不显示它如何称为csc.exe。是否有可能看到整个呼叫执行csc让我们说? – pencilCake 2012-03-06 11:43:08

+0

如果您没有看到日志中的csc.exe命令行,那么您没有以详细模式运行。在详细模式下,日志应显示如下内容:任务“Csc” C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Csc.exe/noconfig/nowarn:1701,1702/nostdlib +/errorreport:prompt /战争 n:4/define:DEBUG; TRACE; SILVERLIGHT/reference:... – 2012-03-06 15:16:05

0

在每个项目中(在这种情况下,C#的csproj)文件是使用的msbuild /视觉工作室构建的msbuild的链接。

例如<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

该目标链接到使用的内部文件。

2

尼克Nieslanik他回答说,实际的工具包会根据项目的类型(和目标编程语言),甚至选择.NET framework版本。

要对MSBuild使用的所有定义,属性,目标等进行单一视图,可以生成并查看完全预处理的项目文件(仅适用于MSBuild 4.0或更新版本)。

msbuild.exe /?输出:

/preprocess[:file] 
        Creates a single, aggregated project file by 
        inlining all the files that would be imported during a 
        build, with their boundaries marked. This can be 
        useful for figuring out what files are being imported 
        and from where, and what they will contribute to 
        the build. By default the output is written to 
        the console window. If the path to an output file 
        is provided that will be used instead. 
        (Short form: /pp) 
        Example: 

        /pp:out.txt 

例子:

msbuild.exe myproj.csproj /pp:out.xml 

在这种情况下out.xml基本上是一个自包含的文件,内嵌有所有Import -ed项目文件,所以你可以轻松地搜索并浏览它们。

相关问题