Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging two or more visual studio project into a one project

I am working on a solution that contains bunch of projects. I am going to refactor the solution by merging some of the projects together.

Is there any tool or visual studio extension that helps me refactor my large solution by merging one or more projects into on project.

Of course this can be done manually but I am hoping for a more automated solution!

like image 770
Coder Avatar asked Sep 03 '10 11:09

Coder


2 Answers

Try "Move to Folder" refactoring in ReSharper, it will deal with namespace and using directive changes that the merge implies.

  1. In Solution Explorer, select files that you want to move from your source project to your target project.
  2. Choose ReSharper > Refactor > Move. Here's how the refactoring dialog looks like.
  3. Choose a destination project (or a folder in it).
  4. Make sure to keep "Fix namespaces" selected and apply the refactoring.

If there are conflicts that prevent the move, ReSharper will let you know about them. Otherwise, the refactoring will be applied immediately.

P.S. I work at JetBrains

like image 110
Jura Gorohovsky Avatar answered Nov 02 '22 03:11

Jura Gorohovsky


You can drag and drop items from one project to another.

Any namespace etc. changes you want will need to be done manually.

This will copy the files, and create as an add to any integrated VCS.

Another approach is to branch in VCS into the destination project and then use "add existing item" to add. This will (depending on your VCS) maintain history.

like image 2
Richard Avatar answered Nov 02 '22 04:11

Richard