views:

4794

answers:

8

Our team is developing a new product on the base of the old one and I received an honorable task of renaming old projects to the new name. For example:

  • project OldProductLib.vcproj must become NewProductLib.vcproj
  • \main\OldLib must become \main\NewLib

... and such.

Does anyone have a methodology and/or tool that would help me do this? What I'm looking for is a tool which will rename directory, update solution, correctly update TFS.

A: 

Have you tried doing it in visual studio...

It can rename your project and I think creates the folders and the like for you.

Omar Kooheji
Nope. Renamed a project in VS, but the file name stayed as-is. Same for
galets
... Same for folder - stayed as it was
galets
+1  A: 

I understand this is possible but it is a painful experience. An easier option is to create a new project and branch everything into it.

Chris Simpson
+1  A: 

You can rename the projects in Visual Studio, and it'll fix up a lot of stuff for you. It won't, however, fix the folder names. Here's what I do when renaming a project.

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

This will leave behind some items, like dlls with the old name in the bin folders.

Now, for the TFS problem. I think when you add the projects back into the solution they will want to create new entries in TFS. This probably isn't what you want. I don't have a TFS available to me in order to test this right now, so I might have this part wrong, but I think if you were to update the "working folder" for a project between steps 2 and 3 it might hook it back up correctly. Try this with a small sample solution before doing it with anything terribly important.

Mel
A: 

Any concrete solution found for this? I'm also looking for the same thing.

A: 

Any concrete solution found for this? I'm also looking for the same thing.

A: 

Renaming project folders in Visual Studio 2008 has been discussed here, and the accepted solution was very useful to me.

Unfortunately, I am unable to help with TFS, but if you use Visual Studio to change the path to the project, perhaps it will handle the situation gracefully (one would expect it would).

alexsome
+1  A: 

You have to use the TFS "Source Control Explorer" view for renaming.

Stefan
A: 

For the TFS part, I think you can use "Change Source Control" command at File->Source Control to rebind the projects after moving.

Catherine