Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: How to make one solution depend on another?

Is it possible to make a solution in VS depend on (i.e. include) an entire other solution? I've seen some stuff about "Solution Folders", but these don't seem to be the same thing....? Thanks! (BTW, I'm using VS 2008)

like image 783
Robert Fraser Avatar asked Jul 20 '09 09:07

Robert Fraser


People also ask

What is the difference between Dependencies and references in Visual Studio?

They are basically no different, they are used to store and manage references. Just as Lex said, the Dependencies is a better way to represent different types of references, we can clearly know where the reference comes from, SDK, nuget, etc. so that we can manage our references more efficiently.


2 Answers

Not really. You'd have to do one of the following:

  • Make a build script that builds the solutions in the correct order.
  • Pre-build solution A, and only reference the built binary outputs from it in solution B.
  • Make a third solution containing all of the projects from both solutions.

The first two items are the most common, where I personally prefer the second.

like image 152
Sam Harwell Avatar answered Nov 09 '22 12:11

Sam Harwell


This post is old, but these days you can easily reuse dependencies in other solutions by building nuget packages for all of them. VS 2015 has nuget package building built in but is currently a Release Candidate. In Visual Studio 2013 you can use the Nuget.Packaging nuget package to allow your project to build as a Nuget Package.

Then you can just publish new versions of your packages to a local network share and configure it as a Repository in Visual Studio.

Then your other solution's projects can depend on that package.

For example, say you have a reusable Utility DLL in a Solution Called "Core Framework" and you want to use a utility in there on a WebSite you are building in a solution called "XYZEcosystem".

In the CoreFramework solution you would build a nuget package for the Utility Project that compiles to the utility dll and include the dll and it's pdb file in the package.

Then you publish that to your network share.

So let's say your package has an ID like "XYZ.Core.Utilities" with a version of 1.0.0.0.

Now in XYZEcosystem you would use the package manager console, set the repository drop down to your repository and type "Install-Package XYZ.Core.Utilities" and it will install the latest version of XYZ.Core.Utilities.

If you make a change to XYZ.Core.Utilities you can run Update-Package XYZ.Core.Utilities on XYZEcosystem and it will pick up the new version.

like image 33
Ryan Mann Avatar answered Nov 09 '22 12:11

Ryan Mann