Move / rename a project in Visual Studio 2008 using TFS

Our team is developing a new product based on the old one, and I got the honorable task of renaming old projects to a new name. For instance:

  • The project OldProductLib.vcproj should become NewProductLib.vcproj
  • \ main \ OldLib should become \ main \ NewLib

... and such.

Does anyone have a methodology and / or tool to help me do this? I am looking for a tool that will rename a directory, update a solution, update TFS correctly.

+4
source share
7 answers

You can rename projects in Visual Studio and this will fix a lot of things for you. However, it will not correct folder names. Here is what I do when renaming a project.

1) Remove the project from the solution. 2) Rename the folder where the project is located. 3) Re-add the project to the solution. 4) Rename the project in Visual Studio.

This will leave some elements, for example, dll with the old name in bin folders.

Now, for the TFS problem. I think that when you add projects back to the solution, they will want to create new entries in TFS. This is probably not what you want. I don’t have TFS for me to check it right now, so I may have this part wrong, but I think that if you updated the “working folder” for the project between steps 2 and 3, it could hook it works correctly . Try this with a small sample before doing this with something terrible.

+3
source

I understand that this is possible, but it is a painful experience. A simpler option is to create a new project and paste everything into it.

+1
source

To rename, you must use the TFS Source Control view to rename.

+1
source

This is possible in Visual Studio 2012 and Team Foundation Server 2012 . See my answer to a related question for a step-by-step guide on how to rename the project folder and save the history of TFS version control for both files and the project.

+1
source

You tried to do this in visual studio ...

It can rename your project, and I think it creates folders, etc. for you.

0
source

Renaming project folders in Visual Studio 2008 was discussed here , and the decision made was very useful to me.

Unfortunately, I cannot help with TFS, but if you use Visual Studio to change the path to the project, it will probably handle the situation gracefully (you might expect this).

0
source

For the TFS part, I think you can use the "Change control source" command in File-> Source Control to re-run projects after moving.

0
source

All Articles