The best way to rename a project in Visual Studio 2008 [duplicate]

假如想象 提交于 2020-01-02 03:34:08

问题


I always find my self in trouble with a lot of namespace or reference errors when trying to rename a project in VS.

This is how I do it: I click on the project and press F2 and rename it.

What procedure do you guys follow?

I used to work in Eclipse, and there I don't have the problems. Maybe it's easy in VS too and it's just me.


回答1:


Renaming the assembly should not be an issue, unless you have external projects depending on it. Within the same solution, it will carry on working correctly.




回答2:


In the properties for the project, I can set "Assembly name" and "Default namespace", I think it's what I've been look for. I assumed that the namespace was automatically renamed also in that proces.

If i'm still missing something, let me know so I can accept your answer.




回答3:


Try highlighting the root namespace in one of your files, and then hitting F2 and typing the new one in. This will perform a Refactor->Rename (also available via contextual menu), which should change that root namespace in all your files. Then, setting "Default Namespace" and renaming your project should take care of the rest.



来源:https://stackoverflow.com/questions/2856338/the-best-way-to-rename-a-project-in-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!