how to change namespace of entire project?
Go to someplace the namespace is declared in one of your files. Put the cursor on the part of the namespace you want to change, and press F2. This should rename the namespace in every file. At least, it worked in my little demo project I created to test this answer!
Depending on your VS version, the shortcut might also be Ctrl-R,Ctrl-R.
I imagine a simple Replace in Files (Ctrl+Shift+H) will just about do the trick; simply replace namespace DemoApp
with namespace MyApp
. After that, build the solution and look for compile errors for unknown identifiers. Anything that fully qualified DemoApp
will need to be changed to MyApp
.
Just right click the solution, go to properties, change "default namespace" under 'Application' section.
Ctrl+Shift+H not the real solution.
You can use Resharper to change your all namespace definitions in your solution. This is the best way I tried before.
https://www.jetbrains.com/resharper/features/code_refactoring.html