2012-03-22 90 views

回答

1

您可以創建一個批處理文件,並建立所有細節只是管道輸出到文件

例如,創建一個文件的build.bat並添加以下內容:

:: Test build script 
:: Setup command line for build 
if "%DevEnvDir%=="" (
    echo "Setting up PATH" 
    :: use VS80 for VS2005 solution, VS90 for VS2008 solution, 
    :: or VS100 for VS2010 solution 
    call %VS90COMNTOOLS%vsvars32.bat" x86 
) 
msbuild YourProject.sln /t:Rebuild /propertyConfiguration=release > Log.txt 
if %ERRORLEVEL%==0 echo "Build Succeeded" 
if not %ERRORLEVEL%==0 echo "Build Failed, See Log.txt" 

這只是一個例子,但這將記錄輸出到log.txt文件。

+1

這將需要從命令行而不是Visual Studio中運行構建,爲了能夠在Visual Studio Build動作中運行此類msbuild腳本,需要執行一些更多的工作,例如,可以將此作爲「AfterBuild」目標添加,但是具體項目 – sll 2012-03-22 13:17:04