Pages

Wednesday, December 15, 2010

Renaming Solutions / Projects in TFS

From the last refactoring task I did, I’ve found out that renaming projects, and its folders is not an easy process in TFS. Renaming project doesn’t actually rename its folders, and vice versa. It is a tedious task where one has to go back and forth from Source Control Explorer to Solution Explorer, and then obviously, we got multiple check-ins. I was at a point where I wanted to delete the whole solution from Source Control, and add the refactored solution as a new solution, but then we want the project's history.

Below, I documented the process I went through. This is the easiest way I’ve found so far that involves few check-ins and avoids confusions. Let me know if you know something easier.

  1. From Solution Explorer, and Solution / Project’s properties window, rename the solution name, project name, project’s default namespace, assembly name etc.
  2. Check in the changes.
  3. Close the solution (File > Close Solution).
  4. From Source Control Explorer, rename the solution folder name, and the project’s folder name.
  5. Check in the changes.
  6. Delete local files / folders mapped to the solution.
  7. From Source Control Explorer, get the latest (Use -> Get Specific version, select latest version from the drop down, and check overwrite local files).
  8. Open the solution. (Note: it should prompt that it is not able to load all the projects)
  9. From Solution Explorer, remove the unloaded projects from the solution (right click on the project, and click Remove).
  10. From Solution Explorer, add the projects that are under the new folder name using Add Existing Project.
  11. Fix all the references in the projects.
  12. Build the solution and check in.

No comments:

Post a Comment