18

I have a VS2012 project that I'd like to move to a different location in both TFS and the file system, then rename the project with then VS2012 solution. Importantly, I need to make sure that TFS stays in sync with my changes.

Any ideas how to so this would be greatly appreciated. Thanks...

Louis S. Berman
  • 994
  • 1
  • 9
  • 25

3 Answers3

29

You need to use Source Control Explorer and locate your project. You should be able to right click on it and select Move. From there, select where you want it to go in source control.

You should be able to rename the project in Visual Studio by right clicking on the solution file and selecting rename.

A word of caution though - I would highly recommended making this a two step operation. Either rename the project, check in your change, then move it or vice versa. TFS can exhibit some strange behaviors on renames and I would never combine that with a move operation.

As far as changing the location in the file system, that is entirely up to you (unless I am misunderstanding you). Just map the project to a different location in your file system.

Jonathan Nixon
  • 4,940
  • 5
  • 39
  • 53
  • I can vouch for the strange behavior concerning renames. A somewhat related quirk I've noticed is; if you delete a branch, check-in that delete, then create a new branch using the same path and name, it'll resurrect the previously deleted branch instead of starting a fresh new one. – Ben Feb 02 '16 at 16:44
  • @Ben sir I lost my histories of files, thats exacly not what i want, is there any way to move one froject to folder with histories? – Ismail Yilmaz Aug 12 '16 at 09:34
  • @IsmailYilmaz What version of TFS/Visual Studio are you using? There is a "TFS Integration Tool" developed by Microsoft that can migrate Team Projects for you, even across collections. Beware that extra large projects can require lots of "babysitting" the tool. – Ben Aug 12 '16 at 15:23
  • @Ben vs2015 and tfs2013, uh-uh what do you mean by babysitting? – Ismail Yilmaz Aug 12 '16 at 15:31
  • Perhaps this should be a new question on SO? – Jonathan Nixon Aug 12 '16 at 17:52
4

The easiest way to do this is a two step process. 1. Rename the project and update the assembly in the Solution Explorer. Once the build is successful check-in your changes. 2. Edit your solution file [project name].sln and update the project path.

Reload your solution and build.

Greg
  • 41
  • 1
1

You can right click your project in solution explorer and choose 'move' to change where it lives in your tree.

However, this does not actually move your project. This will create a copy your project in the new location and delete the old one, and you will lose your history.

I don't believe there is a way around this.

With that said, you will still be able to get to your previous history if you choose Tools->Options->Source control->Visual Studio Team Foundation and check the Show deleted items in the Source control Explorer.

AaronS
  • 7,649
  • 5
  • 30
  • 56
  • Unfortunately, a "Move" command doesn't appear in VS2012 when I right click on a project. Is it possible that I need to set a configuration item to have the Move command appear? If so, some details would be helpful.... – Louis S. Berman Nov 01 '12 at 00:59
  • Make sure you do a get latest on the project/folder you want to move, then it should be available. – chrisortman Mar 01 '13 at 16:20