javapowered javapowered -4 years ago 192
C# Question

how to change namespace of entire project?

I'm modifing demo application from this article:

I need to update all files to use my namespace, for example now file located here:


is using such namespace:

namespace DemoApp.ViewModel
/// <summary>
/// The ViewModel for the application's main window.
/// </summary>
public class MainWindowViewModel : WorkspaceViewModel

I need to move file here (remove DemoApp folder):


and also to use right namespace:

namespace MyApp.ViewModel

how to do that in visual studio 2010?

upd ok here is possible duplicate visual studio, change project namespace Now i know how to change namespace of the project, but how to move files on file system? (get rid of "DemoApp" folder)

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download