Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended number of projects in Visual Studio Solution

We are starting to develop new application that will include something like 30-50 projects developed by about dozen of developers with C# in MS Visual Studio.

I am working on componentize the application modules in order to support the architecture and enable parallel work.

We have argue: how many solutions should we have?

Some claim that we should have 1-2 solutions with 15-30 projects each. Some claim that we need a solution per component that means about 10-12 solutions with about 3-6 projects each.

I would be happy to hear pros/cons and experience with each direction (or other direction thereof)

like image 906
Ragoler Avatar asked Feb 09 '09 20:02

Ragoler


People also ask

How many projects should you have 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 Visual Studio solution contain multiple projects?

Setting multiple startup projects in Visual Studio is easy… 1 – Right click the solution and select 'Set Startup Projects…'. 2 – Select 'Multiple startup projects' and choose two or more projects. 3 – Press run and Visual Studio will open them in your selected browser.

What is the difference between project and solution in Visual Studio?

A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.

How do I build all projects in Visual Studio?

On the menu bar, choose Build, and then choose either Build ProjectName or Rebuild ProjectName. Choose Build ProjectName to build only those project components that have changed since the most recent build. Choose Rebuild ProjectName to "clean" the project and then build the project files and all project components.


1 Answers

I've worked on products on both extremes: one with ~100 projects in a single solution, and one with >20 solutions, of 4-5 projects each (Test, Business Layer, API, etc).

Each approach has its advantages and disadvantages.

A single solution is very useful when making changes - its easier to work with dependencies, and allows refactoring tools to work well. It does however, result in longer load times and longer build times.

Multiple solutions can help enforce separation of concerns, and keep build/load times low, and may be well suited to having multiple teams with narrower focus, and well defined service boundaries. They do however, have a large drawback when it comes to refactoring, since many references are file, not project references.

Maybe there's room for a hybrid approach use smaller solutions for the most part, but create a single including all projects for times when larger scale changes are required. Of course, you then have to maintain two separate solutions...

Finally, the structure of your projects and dependencies will have some influence on how you organize your solutions.

And keep in mind, in the long run RAM is cheaper than programmer time...

like image 165
Nader Shirazie Avatar answered Oct 13 '22 19:10

Nader Shirazie