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.
- From Solution Explorer, and Solution / Project’s properties window, rename the solution name, project name, project’s default namespace, assembly name etc.
- Check in the changes.
- Close the solution (File > Close Solution).
- From Source Control Explorer, rename the solution folder name, and the project’s folder name.
- Check in the changes.
- Delete local files / folders mapped to the solution.
- From Source Control Explorer, get the latest (Use -> Get Specific version, select latest version from the drop down, and check overwrite local files).
- Open the solution. (Note: it should prompt that it is not able to load all the projects)
- From Solution Explorer, remove the unloaded projects from the solution (right click on the project, and click Remove).
- From Solution Explorer, add the projects that are under the new folder name using Add Existing Project.
- Fix all the references in the projects.
- Build the solution and check in.
No comments:
Post a Comment