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.
In Visual Studio's Source Control Explorer, right-click on a folder or item and select "Get latest version". If your workspace doesn't have that item mapped, it will ask you where you want it to be located on disk and then retrieve it for you. Hope this helps!
Drag a folder to the File Explorer to add it to the current workspace. You can even select and drag multiple folders. Note: Dropping a single folder into the editor region of VS Code will still open the folder in single folder mode.
A workspace is how Visual Studio represents any collection of files in Open Folder, and it's represented by the IWorkspace type. By itself, the workspace doesn't understand the contents or features related to files within the folder.
Sorry for bothering everyone. In the end I took the latest version to solve the issue.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With