MSBuild.ExtensionPack.VisualStudio.TfsSource throws exception on checkout

Nov 5, 2009 at 4:00 PM
Edited Nov 5, 2009 at 4:05 PM

Using the October release of the MSBuild Extension pack, specifying "Checkout" for the "TaskAction" of MSBuild.ExtensionPack.VisualStudio.TfsSource, I am getting the Win32Exception at the bottom when I perform a TFS build. I don't get this error when I use MSBuild SideKick on my machine. I have already looked at a couple of other threads that have the same error messages.

The using task is set up as follows and I have double checked that the path is correct for the DLL on the build agent machine:

<UsingTask AssemblyFile="C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll" TaskName="MSBuild.ExtensionPack.VisualStudio.TfsSource" />

The call is as follows and the paths provided are valid as well as the file exists on the build agent machine:

<MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkout" WorkingDirectory="e:\TFSBuilds\MyApplication\v2010\srcPkgs\Dependencies\" ItemPath="e:\TFSBuilds\MyApplication\v2010\srcPkgs\Dependencies\Application.dll" LogExceptionStack="true" />

Please let me know, if there is something else I need to check or anything else I need to do. On the build agent machine, the path for the TF.exe is: "c:\Program Files\Microsoft Visual Studio 9.0\TFS Build\Common7\IDE\".

Your attention to this is appreciated! Mark

Using "MSBuild.ExtensionPack.VisualStudio.TfsSource" task from assembly "C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll".
Task "MSBuild.ExtensionPack.VisualStudio.TfsSource"
  Resolve TF.exe path
  Unable to resolve TF.exe path. Assuming it is in the PATH environment variable.
  TF Operation: Checkout
  Executing tf.exe checkout "e:\TFSBuilds\MyApplication\v2010\srcPkgs\Dependencies\Application.dll"  /noprompt /recursive
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error : Win32Exception: The system cannot find the file specified
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at System.Diagnostics.Process.Start()
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at MSBuild.ExtensionPack.ShellWrapper.Execute() in c:\Projects\CodePlex\MSBuildExtensionPack\Releases\\Main3.5\Framework\ShellWrapper.cs:line 99
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at MSBuild.ExtensionPack.VisualStudio.TfsSource.ExecuteCommand(String action, String options, String lastOptions) in c:\Projects\CodePlex\MSBuildExtensionPack\Releases\\Main3.5\Framework\VisualStudio\TFSSource.cs:line 455
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at MSBuild.ExtensionPack.VisualStudio.TfsSource.Checkout() in c:\Projects\CodePlex\MSBuildExtensionPack\Releases\\Main3.5\Framework\VisualStudio\TFSSource.cs:line 349
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at MSBuild.ExtensionPack.VisualStudio.TfsSource.InternalExecute() in c:\Projects\CodePlex\MSBuildExtensionPack\Releases\\Main3.5\Framework\VisualStudio\TFSSource.cs:line 276
E:\TFSBuilds\MyApplication\v2010\srcPkgs\Source\Framework\MyProj\myBuild.proj(135,2): error :    at MSBuild.ExtensionPack.BaseTask.Execute() in c:\Projects\CodePlex\MSBuildExtensionPack\Releases\\Main3.5\Common\BaseTask.cs:line 69


Nov 5, 2009 at 4:41 PM
Edited Nov 5, 2009 at 4:53 PM

Hi Mark

The problem is your installation path of Tf.exe. The code expects it to be at

        C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

rather than

        C:\Program Files\Microsoft Visual Studio 9.0\TFS Build\Common7\IDE\

It calculates this path using the VS90COMNTOOLS environment variable. I'm not sure why you have it installed in that path. Your fix will be to add c:\Program Files\Microsoft Visual Studio 9.0\TFS Build\Common7\IDE to your PATH environment variable and reboot the build server.

Hope that helps.


Nov 5, 2009 at 6:08 PM

Thanks for your response, Mike.

Looking at environment variables, VS90COMNTOOLS doesn't exist. I added the VS90COMNTOOLS environment variable and set it. Looking good now! :)