2012-03-02 33 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項目文件,所以你可以輕鬆地搜索並瀏覽它們。

相關問題