2010-07-06 36 views
0

我想知道如何在CruiseControl.NET項目最新版本之前運行一個停止Windows服務的bat文件,因爲它會失敗,說文件正在使用中(通過運行的Windows服務。)我無法弄清楚如何在最新的任務之前運行任務,因爲源控制塊不是任務,而是直接在項目節點下。CruiseControl.NET獲取最新版本之前停止Windows服務

<project name="projectname" queue="queuename" queuePriority="1"> 
    <workingDirectory>C:\Build</workingDirectory> 
    <category>companyname</category> 
    <webURL>http://ip/ccnet/server/local/project/projectname/ViewProjectReport.aspx</webURL> 
    <triggers> 
     <intervalTrigger seconds="60" /> 
    </triggers> 
    <modificationDelaySeconds>60</modificationDelaySeconds> 
    &sc; 
    <tasks> 
     <msbuild> 
     <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable> 
     <workingDirectory>C:\Build\Web\H4</workingDirectory> 
     <projectFile>solution.sln</projectFile> 
     <buildArgs>/v:quiet /noconlog /p:Configuration=Debug</buildArgs> 
     <targets>Build</targets> 
     <timeout>900</timeout> 
     <logger>C:\Program Files\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger> 
     </msbuild> 
     <exec> 
     <executable>deleteTestResults.bat</executable> 
     <baseDirectory>C:\Build\Test\TestCases\H4Test</baseDirectory> 
     <buildArgs></buildArgs> 
     <buildTimeoutSeconds>30</buildTimeoutSeconds> 
     </exec> 
     <exec> 
     <executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe</executable> 
     <baseDirectory>C:\Build\Test\TestCases\</baseDirectory> 
     <buildArgs>/testcontainer:testproject\bin\debug\testproject.dll /runconfig:localtestrun.Testrunconfig /resultsfile:H4Test\testResults.trx</buildArgs> 
     <buildTimeoutSeconds>900</buildTimeoutSeconds> 
     </exec> 
    </tasks> 
    <publishers> 
     <merge> 
     <files> 
      <file>C:\Build\Test\TestCases\testproject\testResults.trx</file> 
     </files> 
     </merge> 
     <xmllogger logDir="C:\Program Files\CruiseControl.NET\Logs\companyname\projectname\" /> 
    </publishers> 
    </project> 

任何幫助將不勝感激,謝謝, 賈斯汀

回答

2

你就不能在MSBuild任務之前增加一個新的高管: 即

<tasks>  
    <exec> 
     <executable>StopMyServices.bat</executable> 
     <baseDirectory>C:\Build\Test\TestCases\H4Test</baseDirectory> 
     <buildArgs></buildArgs> 
     <buildTimeoutSeconds>30</buildTimeoutSeconds> 
    </exec> 
    <msbuild> 
     <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable> 
     <workingDirectory>C:\Build\Web\H4</workingDirectory> 
     <projectFile>solution.sln</projectFile> 
     <buildArgs>/v:quiet /noconlog /p:Configuration=Debug</buildArgs> 
     <targets>Build</targets> 
     <timeout>900</timeout> 
     <logger>C:\Program Files\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger> 
    </msbuild> 
    <exec> 
     <executable>deleteTestResults.bat</executable> 
     <baseDirectory>C:\Build\Test\TestCases\H4Test</baseDirectory> 
     <buildArgs></buildArgs> 
     <buildTimeoutSeconds>30</buildTimeoutSeconds> 
    </exec> 
    <exec> 
     <executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe</executable> 
     <baseDirectory>C:\Build\Test\TestCases\</baseDirectory> 
     <buildArgs>/testcontainer:testproject\bin\debug\testproject.dll /runconfig:localtestrun.Testrunconfig /resultsfile:H4Test\testResults.trx</buildArgs> 
     <buildTimeoutSeconds>900</buildTimeoutSeconds> 
    </exec> 
</tasks> 
+0

衛生署..我在想當源代碼控制被拉下來時,它會嘗試覆蓋正在運行的Windows服務文件和錯誤,但實際上這些文件(exe和dll)不在源代碼管理中,它們只是從構建中生成的,因此您的解決方案工作正常。我正在推翻一切,謝謝。 – Justin 2010-07-06 13:56:07