2013-01-11 155 views
2

我們有一個項目,我們在TFS 2008中定製了TFS構建腳本,當時構建基於MSBuild而不是Workflow文件。此自定義腳本使用<Exec> task來呼叫NAnt進行一些打包。在TFS 2012升級後,升級後的MSBuild構建腳本中的TFS構建失敗並執行任務

我們TFS 2010安裝遷移到新的服務器和升級到TFS 2012後,在TFSBuild.proj文件中該行導致的錯誤:

Target "AfterCompile: (TargetId:321)" in project "C:\Builds\2\Proj\Continuous Integration (Proj)\BuildType\TFSBuild.proj" (target "Compile" depends on it): 
Using "Exec" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". 
Task "Exec" (TaskId:209) 
    Task Parameter:Command=C:\Tools\NAnt\bin\Nant.exe (TaskId:209) 
    Task Parameter:WorkingDirectory=..\Sources\ (TaskId:209) 
    Command: (TaskId:209) 
    C:\Tools\NAnt\bin\Nant.exe (TaskId:209) 
C:\Builds\2\Proj\Continuous Integration (Proj)\BuildType\TFSBuild.proj(225,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The directory name is invalid 
Done executing task "Exec" -- FAILED. (TaskId:209) 
Done building target "AfterCompile" in project "TFSBuild.proj" -- FAILED.: (TargetId:321) 

這行看起來是這樣的:

<Target Name="AfterCompile"> 
    <Exec Command="C:\Tools\NAnt\bin\Nant.exe" WorkingDirectory="..\Sources\" /> 
    <!-- ... --> 
</Target> 
+1

這是否打開了最大詳細日誌記錄?將/ v:diag添加到MsBuild命令行以獲取有關發生的更多信息。 – jessehouwing

+0

我忘了更改日誌記錄的詳細程度,@ jessehouwing,但是一旦我改變診斷信息,就沒有得到任何額外的信息... – bdukes

+0

罷工,我只是在錯誤的地方尋找額外的信息(這不是在在Visual Studio中構建的視圖,僅在放置文件夾中的日誌文件中)。這就是說,它告訴我們的並不多。 – bdukes

回答

3

檢查您的工作目錄。我希望這指向一個不存在的位置。

具體而言,默認SourcesBinaries目錄名稱已在TFS 2012中更改爲srcbin。使用屬性$(SourcesSubdirectory)$(BinariesSubdirectory)可以獲得正確的值。