Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a copy of a Visual Studio 2015 project with a new name

There is an old thread for this question here:

How to make a Copy of a Project/Solution in Microsoft Visual Studio 2012?

But the methods suggested there do not work anymore.

Can someone detail how to do the following:

A quick and dirty way to create a copy of a preexisting VS 2015 project with a new name.

like image 885
Ryan J. Shrott Avatar asked Jul 05 '15 00:07

Ryan J. Shrott


1 Answers

I've done this many times throughout visual studio versions and it's always worked.

Copy the Solution folder

Rename the new folder to what I want [no spaces or special characters]. Go into this folder

Example: MyProject

Rename the .sln file to what I want, usually the same name as the folder.

Example: MyProject.sln

Open the .sln file in notepad. Change the following line in TWO places: one for the solution name and the other to the relative path of your .csproj file.

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OldProjectName", "website\OldProjectName.csproj", "{BDDE3242-B5CA-42C3-A111-A4F5BFCCF28C}"

NEW FIX

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject", "website\ MyProject.csproj", "{BDDE3242-B5CA-42C3-A111-A4F5BFCCF28C}"

Close and save the file. If you want to replace the guids with new ones you can but do a global search and replace to ensure you change all the references.

Next Rename the .csproj file to MyProject.csproj

If you changed the guids in the solution file you will need to change these references in the project file.

Open the solution in Visual Studio

like image 129
Darren - Avatar answered Nov 10 '22 01:11

Darren -