TFS Error - Command "exited with code 1" during build

We recently made some modification to our Team Foundation build server.  Ever since then my automated builds started getting this random error.

error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" workfold /map /workspace:"CTCTFSBUILD1_23" /server:http://servername:8080/ "$/myproject/Current2008/LumenWorks.Framework.IO" "c:\builddir\myproject\IB - Workflow\BuildType\..\Sources\myproject\Current2008\LumenWorks.Framework.IO"" exited with code 1.

It was a weird error because usually if I just started the build again it would complete successfully the next time.  It finally got annoying enough that I did some research and solved the problem.  It was a timeout issue.  So, if there was a heavy load on the build server my build would fail.  Here is the command that was causing the issue.

<Exec WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

Turns out there is "Timeout" property you can set.  I think the default is 30 seconds, but I upped it to 2 minutes just to make sure I didn't timeout due to server load.  Here is the command after I fixed it.

<Exec Timeout="120000" WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

I'm not sure how many people are running into this issue, but it was hard to track down so I posted it here and hopefully it will save some other people some time.

Posted in |


  1. Anonymous Says:

    This post is great. It really helped me with an XCopy command.

    Many, many thanks,

  2. Anonymous Says:

    thanks for explaining the errors... great help

  3. Anonymous Says:

    Well written article.

  4. andrewdudek84 Says:

    Thanks fro taking the time to post this!

  5. Shailesh Patel Says:

    Have you ever get below error ?

    ASPNETCOMPILER : error ASPRUNTIME: Object reference not set to an instance of an object.
    The command exited with code 1

    It's stopping my web application begin compiled.

    Any idea?

  6. Anonymous Says:

    hm.. informative post..

  7. Anonymous Says:

    krishan ieiase arranged hoes wenger robin misty separation centers participle perfecting
    masimundus semikonecolori

  8. jane Says:

    Hey Ben, nice post.. good explanation.. thanks...