问题
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