TFS - Unable to determine the workspace
(August 8, 2006)
While getting the latest code from team foundation server with mutiple workspaces through command line utility in team foundation, you may encounter the following error message like "Unable to determine the workspace"
While using more than one workspace, the system doesn't know in which physical location to get the latest code. That's why it generates an error called "Unable to determine te workspace"
Simple solution is, we must capture latest physical location through DOS command (pushd) and assign to TFS to get the latest code
@ECHO OFF
SET getpath="C:"\TFSGet
ECHO Trying TFS get...
ECHO.
REM IF NOT EXIST Create GetPath
IF NOT EXIST %Getpath% MD %Getpath%
REM if exists remove WORKSPACE and create NEW WORKSPACE
tf workspace /delete WORKSPACENAME /noprompt /s:TFSSERVER
tf workspace /new /s:TFSSERVER WORKSPACENAME /noprompt
REM unmap default WORKING FOLDER for newly created WORKSPACE
tf workfold /s:TFSSERVER /workspace:WORKSPACENAME /unmap $/
REM map WORKING FOLDER for newly created WORKSPACE
tf workfold /server:TFSSERVER /workspace:WORKSPACENAME /map $/TFS/TFSPATH %Getpath%
REM get the recent path through DOS command
pushd %Getpath%
REM get latest source from TFS
tf get /recursive /noprompt
ECHO.
REM move back to actual path through DOS command
popd
ECHO TFS get completed...
R.Arockia Jayaseelan
* Having 6+ Years of experience in Client Server and Web related Technologies.
* Working as a Software Engineer, USA.
User Reviews
Total of 1 reviewSame issue need a fix
Written by Shil Shil on November 26, 2008HiI have similar issue. I am having a separate build server where I need to get latest from TFS and Build and keep the source.I use:tf workfold $/%varWorkfoldLocation% %varLatestCodeLocation%tf get $/%varWorkfoldLocation% /overwrite /force ...





