We have a project where we customized the TFS build script in TFS 2008, back when the builds were MSBuild based, instead of Workflow files. This customized script uses the <Exec> task to call NAnt to do some packaging.
After migrating our TFS 2010 installation to a new server and upgrading to TFS 2012, that line in the TFSBuild.proj file is causing an error:
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)
That line looks like this:
<Target Name="AfterCompile">
<Exec Command="C:\Tools\NAnt\bin\Nant.exe" WorkingDirectory="..\Sources\" />
<!-- ... -->
</Target>
Check your working directory. I expect this to point to a non existing location.
Specifically, the default
SourcesandBinariesdirectory names were changed in TFS 2012 tosrcandbin. Use the properties$(SourcesSubdirectory)and$(BinariesSubdirectory)to get the correct value.