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

微笑、不失礼 提交于 2019-12-03 12:38:06

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.

First off, put it back and undo the changes.

Then, Go to File | Source Control | Workspaces.

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

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

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.

the most crude way here (I don't know if there is any other way) is to put the folder back to its old location , Check in your changes then remap the project to the new folder

When you move files/folders to make the moves pending changes you need to use a TFS client to do the moves.

For one or two files the Team Explorer UI is OK, for more the command line is easiest.

See tf.exe rename on MSDN (tf move is an alias for rename). There is also step by step help on using the GUI: Move, Rename, and Delete Version-Controlled Files and Folders.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!