- Don't.
-
Close Visual Studio and don't open it again until I tell you. Visual Studio is not competent at renaming things.
-
Assuming you're using git, clean the working folder to remove anything that's not in version control (this will help the search-and-replace step because it won't have to go through a bunch of generated files)
git clean -fdx
-
Rename the solution file (
.sln
), the project folders, and the project files (.csproj
,.fsproj
) -
Open the project folder in any good text editor.
-
Search-and-replace across the whole folder and replace and text occurrences of the old name with the new name. Sublime Text and Atom have a tree view where you can right click -> Search in folder. Notepad++ has a "Find in files" option.
-
Hunt around for any weirdly mis-spelt versions of the old name that may not have been caught by the search-and-replace.
-
Specifically, look for a package.nuspec (Nuget package manifest) and check the package name in there. It should probably be the same as the solution.
-
(Finally) Open VS again and see if the project loads.
-
See if it builds.
-
Commit and push everything.
-
Don't forget to update any corresponding servcies and integrations, such as:
- Github repositories
- Continuous Integration configs
ModernRonin has written an automated tool for doing this - give it a go before trying the manual steps here, and let us know how it goes!
Where would you recommend actually changing the names of the folders on disk?
I'm going to try doing this between steps 7 and 8.