简体   繁体   中英

Maximum amount of projects in visual studio 2019 solution

at the moment I'm very frustrated while developing at work. We're working in a visual studio 2019 solution file with 290 projects in it. Our software is written in C# using .NET code.

I'm getting even more frustrated every time when I change a branch of the git repository, because the visual studio then starts a whole reload of the solution which takes up to 5 or 10 minutes.

Do you know if there is a limit for the amount of projects in a visual studio solution? Or did you work within solution with a higher amount than 300 projects?

While there is no enforced limit (in theory you can have thousands of projects in a solution file and visual studio will try to load them) there are some, as you can see here: Recommended number of projects in Visual Studio Solution

  1. Machine limits. After a certain number, non powerful machines take to much to load or even crash.
  2. Older vs version have been reported to crash after a certain number (even lower than yours)
  3. Manageability is also a concern. Too many projects sometimes mean that there should be a better separation of concerns. Having them all in one solution sometimes brings unneeded coupling between unrelated codebases.

If number 3 is not the case, I'd advise you to create multiple solutions, each a subset of the projects per domain area.

If it is, try to refactor and decouple. Each decoupled dll should be moved outside the solution, packaged into a nuget and consumed independently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM