I have a build using a Team Foundation Server VCS root.
In the build scripts (Nant), I have an external call to the tf history command to retrieve change history information.
The first time I ran the build, the tf.exe history command worked ok, but on every build after that it failed with the error "Unable to determine the workspace".
The only way I have found to fix it is to run the command tf workspaces /s:http://tfs-server:8080 to update the mappings cache file, as explained on this blog post: http://blogs.msdn.com/granth/archive/2008/07/22/tf-exe-unable-to-determine-the-workspace.aspx .
After this fix tf history will work, but it fails on the next build unless I run tf workspaces again.
My checkout settings are:
VCS checkout mode: Automatically on agent
Checkout directory: c:\TeamCityBuild\
Clean all files before build: Off
Has anyone has seen this behavior?