Files could not be found in workspace

42,651

Solution 1

Sorry for bothering everyone. In the end I took the latest version to solve the issue.

Solution 2

TFS works with a cache. There is one on your client computer that might be all kinds of confused, so delete the files in it. The default path to it is C:\Users\<Username>\Local Settings\Application Data\Microsoft\Team Foundation\<Version Number>\Cache (This can vary depending on your operating system, but it is in your profile).

You can try to re-establish the solution's/project's bindings by going to File -> Source Control -> Change Source Control... (If this menu item is missing it may mean that you need to reset your menu items). If the source files are already in a workspace, then you can click the Bind icon in the toolbar on the resulting dialog to re-link the file to source control. However, you may still need to perform a get or re-open VS to get it to stop complaining.

I know you mentioned wanting to know if you can do anything except Get Latest version, but TFS 2010 stored the workspace information on the server and needs to connect to re-establish the meta-data. It sounds like you essentially re-created the mappings for your workspace. In doing so the server needs to re-establish the connection. I think the only way to handle this is to perform a get after establishing the workspace. You should not lose anything unless you use the Get Specific Version dialog, but to be safe I would copy your files off to a temporary location before you perform the Get Latest in that workspace regardless. After you perform a Get Latest operation, everything should be fine.

Obviously, you may also want to check your permissions on the folder that the workspace is mapped to (I could not find the exact requirements after searching around a little bit). It is unlikely this is the problem as you seem to know, but if you are unsure then of course you can set the folders you are saving the files to so that your user account has FULL permissions to them recursively and see if that makes a difference.

Also, please ensure you have Visual Studio 2010 SP1 installed.

The behavior is improved in Visual Studio and TFS 2012 with what is called Local Workspaces; With Local Workspaces the meta-data about your files is stored in the filesystem instead of at the server. TFS 2012 should be on the market very soon.

Solution 3

Say okay to prompts. When solution opens (it won’t have files referenced), right-click on solution in solution explorer & choose “Reload Project”

Share:
42,651
Sandy
Author by

Sandy

Enthusiast in technology world and fascinated by new entrepreneurs. Strongly believe in innovation and creativity and looking forward to be a part of it.

Updated on July 15, 2022

Comments

  • Sandy
    Sandy almost 2 years

    I am using Visual Studio 2010 professional with TFS as a source control and everything was working fine. In morning I came I opened my solution and it opened as Offline. I tried going online, and it says

    "Workspace for this solution could not be found."
    

    (I don't remember the exact error sentence).

    I closed my solution. I went to pending changes window -> workspace ComboBox -> manage workspace. I edited my workspace and mapped my solution to the already existing folder.

    Now I was able to see my pending changes in the window. I opened my solution again. I tried checking out a file, and I got error:

    "file could not be found in workspace, or you don't have permission to access the file."

    Any pointers for this except taking the latest version or the specific version. In manage workspace, my workspace was private.