Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link multiple visual studio solutions together?

I have 3 solutions and solution A requires built versions of the DLLs from solution B and C in order to compile. It is not possible to merge it to one solution...

So far it seems that Visual Studio doesn't support solution references and msbuild is clever enough to know that you are building one solution from another etc. if I try that way. The overall goal is to try to make the multiple solutions seem almost like there is only one - just solution A.

I believe this is a common problem, but how do you link it up nicely?

like image 431
Simon P Avatar asked Mar 25 '09 14:03

Simon P


People also ask

How do I add multiple solutions in Visual Studio?

There's a much easier (but not so obvious) way; right click on the Visual Studio icon in the taskbar, then right click on the application name in the popup menu, then click "Open". Windows will then open another instance where you can open another solution in. You can open another instance like any other program.


3 Answers

This question has popped up in different, but related, forms. There is actually an MSDN page that covers this.

What you're looking for is a multi-solution approach akin to the Partitioned Single Solution Model for Larger Systems. Have one "everything" solution that builds everything and maintains your inter-component dependencies. This is what you build when you need to build solution A. You then have separate solutions that only include components B or C. Essentially, you'll still have 3 solutions, but you'll add the projects from solutions B and C into solution A.

like image 78
Greg D Avatar answered Oct 13 '22 08:10

Greg D


I have recently discovered that in Visual Studio 2008 you can include existing projects in multiple solutions. The only downside so far seems to be that if you make a change to a shared project and have multiple solutions open that use that shared project you will be asked to "reload" the other solutions.

So, just "Add Existing Project" to all the solutions that need the project. I am using TFS on my current site and there seems to be no issues with source control ether.

like image 37
Paul Redman Avatar answered Oct 13 '22 07:10

Paul Redman


It should be project level you are looking at I believe. Build the projects contained within Solution B and C and then add references to the DLLs in the relevant projects in Solution A.

In Msbuild if you have a property group

<PropertyGroup>

<SolutionsToBuild>SolutionB</SolutionsToBuild>
<SolutionsToBuild>SolutionC</SolutionsToBuild>
<SolutionsToBuild>SolutionA</SolutionsToBuild>
</PropertyGroup>

Then execute the MSBuild Task

<MSBuild Projects="@(SolutionsToBuild)"/>

Hope this helps

like image 21
Dean Avatar answered Oct 13 '22 07:10

Dean