Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio solutions with large numbers of projects

I see developers frequently developing against a solution containing all the projects (27) in a system. This raises problems of build duration (5 minutes), performance of Visual Studio (such as intellisense latency), plus it doesn't force developer's to think about project dependencies (until they get a circular reference issue).

Is it a good idea to break down a solution like this into smaller solutions that are compilable and testable independent of the "mother" solution? Are there any potential pitfalls with this approach?

like image 762
Ben Aston Avatar asked Jun 27 '10 22:06

Ben Aston


People also ask

Can a Visual Studio solution contain multiple projects?

Visual Studio extension that allows adding multiple existing projects into the solution. Optionally creates the solution folder structure reflecting to the physical hierarchy on disk. See the change log for changes and road map.

How many projects are in a solution Visual Studio?

Some authors propose a number between 15-20 maximum projects in a Visual Studio Solution to be a good compromise.

How many projects is too many in a solution?

Research suggests 2-3 projects at a time is optimal for individual focus and collective scheduling. If you're asking people to juggle more than this then you are lowering their productivity. Too Many Projects will damage your business and drive you into a self-perpetuating low productivity fire-fighting culture.

Can a solution have multiple projects?

Sometimes, solutions have more than one application in them. Or they have lots of unrelated projects in them.


2 Answers

Let me restate your questions:

Is it a good idea to break down a solution like this into smaller solutions

The MSDN article you linked makes a quite clear statement:

Important Unless you have very good reasons to use a multi-solution model, you should avoid this and adopt either a single solution model, or in larger systems, a partitioned single solution model. These are simpler to work with and offer a number of significant advantages over the multi-solution model, which are discussed in the following sections.

Moreover, the article recommends that you always have a single "master" solution file in your build process.

Are there any potential pitfalls with this approach?

You will have to deal with the following issues (which actually can be quite hard to do, same source as the above quote):

The multi-solution model suffers from the following disadvantages:

  • You are forced to use file references when you need to reference an assembly generated by a project in a separate solution. These (unlike project references) do not automatically set up build dependencies. This means that you must address the issue of solution build order within the system build script. While this can be managed, it adds extra complexity to the build process.
  • You are also forced to reference a specific configuration build of a DLL (for example, the Release or Debug version). Project references automatically manage this and reference the currently active configuration in Visual Studio .NET.
  • When you work with single solutions, you can get the latest code (perhaps in other projects) developed by other team members to perform local integration testing. You can confirm that nothing breaks before you check your code back into VSS ready for the next system build. In a multi-solution system this is much harder to do, because you can test your solution against other solutions only by using the results of the previous system build.
like image 90
Dirk Vollmar Avatar answered Sep 22 '22 02:09

Dirk Vollmar


Visual Studio 2010 Ultimate has several tools to help you better understand and manage dependencies in existing code:

  • Dependency graphs and Architecture Explorer
  • Sequence diagrams
  • Layer diagrams and validation

For more info, see Exploring Existing Code. The Visualization and Modeling Feature Pack provides dependency graph support for C++ and C code.

like image 31
Esther Fan - MSFT Avatar answered Sep 26 '22 02:09

Esther Fan - MSFT