I\'m modifying demo application from this article: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
I need to update all files to use my namespace, for example
In asp.net is more to do, to get completely running under another namespace.
I know its quite late but for anyone looking to do it from now on, I hope this answer proves of some help. If you have CodeRush Express
(free version, and a 'must have') installed, it offers a simple way to change a project wide namespace. You just place your cursor on the namespace that you want to change and it shall display a smart tag
(a little blue box) underneath namespace
string. You can either click that box or press Ctrl + keys to see the Rename
option. Select it and then type in the new name for the project wide namespace, click Apply
and select what places in your project you'd want it to change, in the new dialog and OK
it. Done! :-)
You can use CTRL+R, CTRL+R or for complex namespace changes use this tool https://marketplace.visualstudio.com/items?itemName=vs-publisher-599079.FixNamespace
You can use ReSharper for namespace refactoring. It will give 30 days free trial. It will change namespace as per folder structure.
Steps:
Right click on the project/folder/files you want to refactor.
If you have installed ReSharper then you will get an option Refactor->Adjust Namespaces.... So click on this.
It will automatically change the name spaces of all the selected files.
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
.