Visual Studio 2010 - how to move a common shared project without losing references in other projects

Problem:
You have a shared project that is referenced by lots of other projects, and you want to move the project,
without having to re-add the reference to all the projects.

Solution:
Move the project.
Open the solution which contains the project, and the other projects that reference it.
Visual Studio will show an error, that not all projects could be loaded.
Select OK.

In Solution Explorer, use CTRL to select all of the projects which reference the missing project.
Right-click and select Unload project.

Right-click on the project which you moved, and select Remove.
Select OK.

Right-click on the solution, and select Add Existing item.
Add the common project from the location where you have moved it to.


In Solution Explorer, use CTRL to select all of the projects which reference the missing project.
Right-click and select Load project.


The projects should automatically pick up the reference to the shared project, provided of course that the reference was by Project and not directly to the output binary of that project.

note: this works OK for C# projects.

For VB.NET projects, I found this additional step necessary:

Right-click on the VB.NET project, and select Properties.
Select the References tab.
Select the Add button.
Select the Projects tab.
Add the shared project.

The projects should now all pick up the reference to the shared project, at its new location.

Comments