Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 672
radbyx Avatar asked May 18 '10 10:05

radbyx


People also ask

How do I clone a Visual Studio project?

Open Visual Studio. On the start window, select Clone a repository. Enter or type the repository location, and then select the Clone button.

How do I Rename a project in Visual Studio solution?

Visual Studio is not competent at renaming things. Open the project folder in any good text editor. Search-and-replace across the whole folder and replace and text occurrences of the old name with the new name. Sublime Text and Atom have a tree view where you can right click -> Search in folder.


1 Answers

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.

like image 99
drharris Avatar answered Nov 02 '22 00:11

drharris