我们有一个项目,我们在 TFS 2008 中自定义了 TFS 构建脚本,当时构建基于 MSBuild,而不是工作流文件。这个自定义脚本使用<Exec>
任务调用 NAnt 进行一些打包。
将我们的 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>