Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Visual Studio Team Foundation Server to see I moved code to a different folder?

I moved some code from my c drive to my d drive. When I opened the solution, it told me that:

The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control.

So I tried permanently removing the bindings and downloaded the latest version. Now my changes don't register as pending changes.

I've tried selecting the solution in the Solution Explorer and File => Source Control => Change Source control, but it does not let me bind. Server Name and Server Binding columns have "".

like image 415
malckier Avatar asked Mar 14 '12 14:03

malckier


People also ask

How do I get the TFS code for a local directory?

From Visual Studio, go to the Team Explorer Connect page (Keyboard: Ctrl + 0, C) and then connect to the project. (If the project you want to open is not listed, choose Select Projects and then connect to the project.) Map the project to a folder on your dev machine. Map the workspace and get your code.

How do I add a folder to TFS Source Control?

On the Source Control Explorer tab, in the Folders pane, select the folder that contains the item or items you want to add. Click the Add Items to Folder button. In the Add to Source Control dialog box, select the folder or items you want to add, and then click Next.


2 Answers

Generally speaking, the location of code on your machine is dependent upon where your workspace is located.

If you move your workspace to the D: drive, then there shouldn't be an issue.

However, if you simply used Explorer to copy the files to the new location, then VS isn't going to be able to maintain the bindings.

From the Workspace Editor you can map the entire tree, solutions or even individual projects to a new location.

  1. First off, put it back and undo the changes.

  2. Then, Go to File | Source Control | Workspaces.

  3. Click on the work space name and then the "Edit..." button.

  4. In the working folders area select the source control folder you want to move and give it a new local folder location.

like image 146
NotMe Avatar answered Sep 20 '22 13:09

NotMe


You will need to edit your Workspaces for TFS Server to know the change that has happened at your local machine. To edit your workspace, in Visual Studio:

  • ensure you have no pending changes; also copy your source code folder to some location temporarily, just to be safe (you can remove after you are all set)
  • go to Source Control Explorer
  • locate the "Workspace:" dropdown
  • select the item "Workspaces" from the dropdown list (you will get a dialog titled "Manage Workspaces"
  • if you have multiple Workspaces, select the appropriate one from the list in the dialog
  • click on "Edit" button (you will get an "Edit Workspace..." dialog)
  • down below in the dialog, you will see "Working folders" grid
  • click on appropriate row from the grid and modify the "Local folder" path to set to your new folder location

Sometimes TFS and Visual Studio have issues in getting these workspace changes synchronized. I would always close Visual Studio and re-launch it to get my changes synchronized anytime after I make Workspace related changes.

Hope this helps.

like image 21
Arun Avatar answered Sep 20 '22 13:09

Arun