Have you ever wanted to rename a namespace but you have too many classes in the namespace that it would be an infeasible hassle changing all of them individually. Even using a tool like ReSharper to refactor the namespaces class by class is a hassle. Here is how to rename a namespace for all of its classes in a couple of key strokes using ReSharper.
- Open Class View (Ctrl + Shift + C)
- Choose the namespace you want to rename
- Press Ctrl + R, R*
or right-click on the namespace an choose Refactor > Rename
- Pick another name
- Hit Next
Update! Alternate context menu option to rename namespaces. Tested with ReSharper 5.1.
and you're done!
Please leave a comment if you found this useful.
* Visual Studio scheme