Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 now file located here:

MySolutionMyAppDemoAppViewModelMainWindowViewModel.cs

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):

MySolutionMyAppViewModelMainWindowViewModel.cs

and also to use right namespace:

namespace MyApp.ViewModel
{
....

how to do that in visual studio 2010?

Update ok here is possible duplicate Change Project Namespace in Visual Studio Now I know how to change the namespace of the project, but how to move files on the file system? (get rid of "DemoApp" folder)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
270 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...