Question

When I tried to call command-line to get latest update for my TFS mapped folder

TF get /recursive

The call complete successfully from the run window of Windows 7.

However, when I put the call into a .bat file and run it via InvokeProcess within a build definition (guide to do that), it failed.

The message is as below.

Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'

What happens? How can I get around with that?

Was it helpful?

Solution 2

The cause for my issue is that the build agent execute my .bat file under a different Windows account which is something like NTSERVICE; when I run it directly, my TFS login account was used (which was previously remembered in Windows 7 Credential Manager)

So the solution is to put in the login name and password as TF get /login:SomeTFSUsername,SomePassword (see more here)

OTHER TIPS

The reason this is happening is because when you run the command locally, the folder you're downloading is mapped to a workspace. When you execute the command in your build, it's running under the build service account, which doesn't have a workspace mapped for the folder you're specifying.

You shouldn't need to use the tf get command as part of your build. When you configure your build, you can specify which folders should be mapped in the workspace on the "Source Settings" tab. The build process will handle making sure the contents of the folders you map in your workspace are present automatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top