如何更改整个项目的名称空间? [英] how to change namespace of entire project?
问题描述
我正在从本文中修改演示应用程序: http://msdn. microsoft.com/en-us/magazine/dd419663.aspx
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:
MySolution\MyApp\DemoApp\ViewModel\MainWindowViewModel.cs
正在使用这样的命名空间:
is using such namespace:
namespace DemoApp.ViewModel
{
/// <summary>
/// The ViewModel for the application's main window.
/// </summary>
public class MainWindowViewModel : WorkspaceViewModel
我需要在此处移动文件(删除DemoApp文件夹):
I need to move file here (remove DemoApp folder):
MySolution\MyApp\ViewModel\MainWindowViewModel.cs
并使用正确的名称空间:
and also to use right namespace:
namespace MyApp.ViewModel
{
....
如何在Visual Studio 2010中做到这一点?
how to do that in visual studio 2010?
更新,确定可以在此处重复在Visual Studio中更改项目命名空间现在,我知道如何更改项目的名称空间,但是如何在文件系统上移动文件? (摆脱"DemoApp"文件夹)
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)
推荐答案
我想象一个简单的文件替换( Ctrl + Shift + H )就可以解决问题;只需将namespace DemoApp
替换为namespace MyApp
.之后,构建解决方案并查找未知标识符的编译错误.完全合格的DemoApp
都需要更改为MyApp
.
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
.
这篇关于如何更改整个项目的名称空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!