Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to determine the workspace using TF.exe

Tags:

I have this script (bat file)

tf workspaces /s:http://project02:8080  tf workspace /s:http://project02:8080 Team.descomp;MyDomain\Myuser   tf workfold /workspace:Team.descomp   tf get $/Team/Main/Projects /recursive /force /noprompt 

I get this error: Unable to determine the workspace., when I try execute tf get.

Console output is similar like:

Server: project02

Workspace: DESCOMP

Owner : MyUser

Computer : DESCOMP

Workspace: Team.descomp

Owner : MyUser

Computer : DESCOMP

...

Workspace: Team.descomp (MyUser)

Server : http://project02:8080/

$/Team: C:\Temp\Team2

...

Unable to determine the workspace.

Note, for $/Team (team project) has map in two machines: MyUser and Descomp

Workspace: Team Owner : MyUser Computer : MyUser

Workspace: Team.descomp Owner : MyUser Computer : DESCOMP

Any suggestions?

like image 910
Kiquenet Avatar asked Feb 01 '11 14:02

Kiquenet


2 Answers

From Forums MSDN: Mr. Hofman

http://social.msdn.microsoft.com/Forums/en/tfsbuild/thread/82b13bfd-5fd7-45f7-a681-d84c9ea52765

Change the working folder for the tf get to a folder that is mapped by the workspace.

Execute the command from a folder where the workspace is mapped

(for example if you do it from console:

cd c:\sources\myteamproject  tf get ... 

)


Key: Change the working folder for the tf get to a folder that is mapped by the workspace.

I use command pushd C:\Temp\Team2 in my script file.

Update: Comments by Ryan Cromwell

You can create and map a workspace in your script with the following. The second command works, because the first workspace is created in the 'blah' folder. The '.' in the second command is saying map '$/' to the current directory (blah). You could change that to be a named folder or subfolder if you choose.

Create a new workspace
C:\projects\blah>tf workspace /new blah /noprompt /collection:http://<host>:<port>/tfs/<collection> /login:<username>,<pwd>

Map a path in that workspace
C:\projects\blah>tf workfold /map $/ . /login:<username>,<pwd>

like image 102
Kiquenet Avatar answered Sep 17 '22 20:09

Kiquenet


This extends @Kiquenet answer. It wasn't easily done in the comments :(

You can create and map a workspace in your script with the following. The second command works, because the first workspace is created in the 'blah' folder. The '.' in the second command is saying map '$/' to the current directory (blah). You could change that to be a named folder or subfolder if you choose.

Create a new workspace
C:\projects\blah>tf workspace /new blah /noprompt /collection:http://<host>:<port>/tfs/<collection> /login:<username>,<pwd>

Map a path in that workspace
C:\projects\blah>tf workfold /map $/ . /login:<username>,<pwd>

like image 42
Ryan Cromwell Avatar answered Sep 18 '22 20:09

Ryan Cromwell