C# 如何重命名 Visual Studio 2008 中的现有解决方案和项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11878904/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to rename existing solution and project in Visual Studio 2008?
提问by Samy S.Rathore
Possible Duplicate:
how to rename a project without killing solution
可能的重复:
如何在不杀死解决方案的情况下重命名项目
I know that this question has been frequently asked, but none could help me overcome the fear of rendering my application useless by improper renaming of my solution,
我知道这个问题经常被问到,但没有人能帮助我克服对解决方案的不正确重命名而使我的应用程序无用的恐惧,
I am working on a C# Windows application in VS 2008, as in initial step i was unaware of the fact that renaming is such a big issue in VS, i named the project "stock"but now that my project is nearly completed, my lead wants to rename the namespace to BetRates_NSas that is the name of the deployment setup project,
我正在 VS 2008 中开发 C# Windows 应用程序,因为在初始步骤中,我不知道重命名在 VS 中是一个如此大的问题,我命名了该项目,"stock"但现在我的项目已接近完成,我的领导想重命名命名空间,BetRates_NS因为它是部署设置项目的名称,
i even have web service references in my solution and other dependencies with the namespace name, ans based on my previous experience, renaming is not so easy in VS,
我什至在我的解决方案和其他依赖项中都有 Web 服务引用和命名空间名称,根据我以前的经验,在 VS 中重命名并不是那么容易,
so can some1 please give me the exact step by step process to rename my solution so that the application might run smooth now and may not crash at a later point of time due to this.
所以请some1请给我准确的分步过程来重命名我的解决方案,以便应用程序现在可以顺利运行并且不会因此而在以后的某个时间点崩溃。
i am totally hoping for some help here.....thanxx in advance......!!
我完全希望能在这里得到一些帮助.....thanxx 提前......!!
this is my solution explorer screenie:
这是我的解决方案资源管理器屏幕:


采纳答案by JohnnBlade
Try this
尝试这个
Press CTRL + H then enter your old name that you wanna change to a new name
按 CTRL + H 然后输入要更改为新名称的旧名称
by the option look in, you can also choose current project or entire solution
通过选项查找,您还可以选择当前项目或整个解决方案


You can also change your namespace in your project properties
您还可以在项目属性中更改命名空间


** Or you can create a new solution, and add those projects to your new solution and build it
** 或者您可以创建一个新的解决方案,并将这些项目添加到您的新解决方案并构建它

