views:

45

answers:

3

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!

A: 

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.

Richard
Yes, but this is the manual approach I was looking for an automated way to accomplish this
Coder
A: 

The far better way is to write a utility of your own with custom logics to update the .csproj or .vbproj files and moving the files to specific folder and re-naming the namespaces. That will saves lot of time.

But, there are few tools available. I don't how they are upto.

http://slntools.codeplex.com/
http://www.projectmerge.com/index.php

HTH

Avatar
A: 

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

gorohoroh