JAIME GAFFOD JR
JAIME GAFFOD JR

Reputation: 113

Renaming project / solution in Visual studio

I want to rename the project/solution name for example from Project1.sln to Project2.sln

Is that just simply by going to View > Properties Window then rename the Name property or there is an additional step?

Upvotes: 5

Views: 25452

Answers (3)

Julian
Julian

Reputation: 36800

Renaming projects could be challenging in visual studio, as vanilla visual studio won't help you much. (Read = manual editing files)

If you also want to rename the file system folder, follow these steps:

  1. Rename the project in Visual Studio
  2. Close the solution or unload the project
  3. Rename the project folder outside Visual Studio.
  4. Change the project name in solution file (.sln) with an text editor
  5. Change project name in other projects which referenced(used) to it
  6. (optional) Change assembly name and information
  7. (optional) Change default/root namespace

Upvotes: 9

Modern Ronin
Modern Ronin

Reputation: 701

Or you use a tool that I wrote for myself, that also deals with renaming in git so the history is not lost, moving to different directories etc.

Install via dotnet tool install -g ModernRonin.ProjectRenamer, see https://github.com/ModernRonin/ProjectRenamer for documentation.

Upvotes: 2

Dave
Dave

Reputation: 3017

If like most of us your namespaces are based on project names then you will need to rename all your namespaces to match. You will also need to change the default namespace of the project in the properties.

Upvotes: 1

Related Questions