Solution And Project Renaming - egnomerator/misc GitHub Wiki
- Right-click on the Solution root node and choose rename; enter the new name
- if you have File Explorer open to the directory containing the .sln file, you will see the file name updated by this action
- (alternatively, rename the .sln file in File Explorer)
- Sanity checks
- May need to save all, close Visual Studio, an reopen the solution in VS if one of these below steps has issues
- Rebuild Solution
- Run all tests
- Manual functional tests
Renaming a solution project is a much more complicated process than renaming a solution.
If a solution has many projects, the below steps will need to be repeated for each project that needs its name updated.
- Right-click the project in Solution Explorer, select Rename, and enter the new name
- Right-click the project again and select Properties. Change the "Assembly name" and "Default namespace" on the Application tab.
- Right-click the project again and select Refactor -> Adjust Namespaces. Accept the changes.
- if no Resharper:
- manually update all the namespaces of this projects' classes
- manually update all areas referencing these classes accordingly
- if no Resharper:
- Change the AssemblyTitle and AssemblyProduct in Properties/AssemblyInfo.cs
- In File Explorer, delete the project's bin and obj directories
- In File Explorer rename the project's directory
- Save all, close Visual Studio, reopen the solution in VS
- Visual Studio won't be able to load the project (it will display as "unavailable"), so update the .sln file
- Open the .sln file (with a text editor such as Notepad++) and change the path to the project (there may be multiple places)
- This action may require opening the file with admin privileges
- Say Reload when Visual Studio prompts to reload projects due to updates
- (this will occur when going back to VS after saving the .sln file updates)
- Sanity checks
- During these sanity checks, the compiler may reveal some more issues to fix manually
- This process is tough to nail down a tried and true, unvarying set of steps for
- Rebuild Solution
- Run all tests
- Manual functional tests
- During these sanity checks, the compiler may reveal some more issues to fix manually