开发者

How can I change the name of my project and have it reflect everywhere?

开发者 https://www.devze.com 2023-02-27 00:58 出处:网络
I created a project in Visual Studio 2010 but I mispelled the name well into development. If I right click, and rename the project开发者_StackOverflow社区, it seems the changes aren\'t cascaded to fo

I created a project in Visual Studio 2010 but I mispelled the name well into development.

If I right click, and rename the project开发者_StackOverflow社区, it seems the changes aren't cascaded to folders and classes.

For example, if my project was named Foa and I added a class, the namespace would be:

namespace Foa
{
    public class Bar

If I renamed the project to Foo, the class stays:

namespace Foa
{
    public class bar

Is there a way to cascade that change?


Change the namespace in one spot and then Ctrl+. on it and choose the refactor option. This will change the namespace throughout.


Change the default namespace in the project properties, then use a refactor tool to change the namespaces. Resharper has a fix inconsistent namespaces tool that will do it but you can just use the visual studio refactor to do it manually.

0

精彩评论

暂无评论...
验证码 换一张
取 消