Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename project folder in Visual studio and Team foundation server

My Visual Studio 2013 solution has a project "Test". I can rename it in solution explorer, but I also want to rename the project folder in disk and also reflect the change in Source Control(TFS). How can I easily do this?

Thank you

like image 487
Sheen Avatar asked Oct 20 '22 16:10

Sheen


2 Answers

@CodeCaster, Thank you. Based on your advice, I have done some quick experiment, and worked it out. First step is rename the folder name in TFS; the new folder will appear in local workspace and all contents of the folder moved to this new folder. The old folder stays there with rest content which not belong to source control. You can delete it manually.


Or Using TFS Power Tools to rename from Explorer. Renaming TFS folder using TFS power tools

like image 64
Sheen Avatar answered Oct 27 '22 23:10

Sheen


I followed those steps to preserve the version history of the files inside of TFS:

  1. Rename/move project file (.csproj) in source control explorer in VS (alternatively, this also works from within VS Solution explorer, simply select "rename")
  2. Rename/move project folder in source control explorer in VS
  3. now the project should be unavailable in VS, solution also gets closed
  4. remove project from VS
  5. add project (new path) to VS
  6. fix project references in other projects
  7. adjust namespaces if desired
  8. adjust assembly name and default namespace in project settings

Don't know of an easier way. Was searching for this myself, and this should be the way to go.

like image 24
Andreas Reiff Avatar answered Oct 27 '22 22:10

Andreas Reiff