Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

c# - 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?

question from:https://stackoverflow.com/questions/66052965/maximum-amount-of-projects-in-visual-studio-2019-solution

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...