Sometimes when you're working with the tf.exe and tfpt.exe command-line tools you'll come across this error:
D:\code\ProjectX>tf.exe checkout MyFile.cs
Unable to determine the workspace.
This error happens when the command can’t find which local directory maps to which server path.
Obviously, the first thing to check is your workspace mappings. Is the local folder actually mapped? You can do this two ways:
- Open Visual Studio | File | Source Control... | Workspaces, or
- Open a command prompt and type: tf workspaces /server:http://tfs-server:8080 /owner:domain\username
Each of these will show you all the available workspaces and their mappings.
Owner : user
Computer : MYCOMPUTER
Server : tfs-server
If the workspace mapping exists on the server, then your mappings cache file may need to be refreshed. Try running this command to populate/refresh the cache:
tf workspaces /s:http://tfs-server:8080
This will force your machine to update its local server-to-folder mappings cache file. This file is located at %LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache in Vista.