tf.exe: Unable to determine the workspace

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.


Workspace: MyWorkspace_ProjectX

Owner    : user


Comment  :

Server   : tfs-server

  $/ProjectX: D:\code\ProjectX

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.

Comments (8)
  1. I’ve been looking at my blog stats for the last couple of months to see what people find valuable on

  2. Neil Whitaker says:

    Thank you for your post. Unfortunately, it didn’t help me, but I did find the solution:

    Whereas Windows file paths are case-insensitive, TFS workspace detection is case-sensitive.

    I use a shortcut to open the vs command prompt. The shortcut had start in as "D:projects…", and that’s what I see as the prompt when I click the shortcut. However, the actual file system path is "D:Projects…". Because of this difference,

    TFS was not finding the workspace.

  3. Harishwar Bomma says:

    I was facing through the same problem of not recognizing the workspace.

    The post about refreshing the cache by "tf workspaces /s:http://tfs-server:8080" was very useful to me

    Thanks a lot :)

  4. Marielle says:

    Since this is the first place google brought me to…I should mention I was getting the exact same error and it was really frustrating that nothing I found on the web was helping until I figured out that my path was executing the 2008 tf.exe when it needed to be the 2010 tf.exe version.

  5. Dan Kordik says:

    @Marielle: thanks so much for commenting, that was my issue too. (running 2008 tf.exe when I should be running 2010)

  6. VS Version is Important says:

    Thank you, I was running TF.exe from VS 2005, I needed it to be VS 2010!

  7. louisila says:

    Thanks that sorted me out.. your awesome.

  8. Pradeep says:

    I have 2 users mapped the same Server Path to Different Local Path, so how does the tf get understand which workspace to use to get the latest?

Comments are closed.

Skip to main content