Importance of more than one project in single solution in Visual studio | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Importance of more than one project in single solution in Visual studio

Hi all We can have one solution per project and can have seperate DLL for each of them... Also people club few projects in a single solution in Visual studio.... Why this is preferred i.e. what is important advantage we may get by doing so ?

8th Aug 2020, 9:20 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
14 Answers
+ 4
Ketan Lalcheta Having several projects in a single solution is typical on larger, team based applications. Such code bases comprise of common library projects, unit test libraries, services and console apps. Following TDD/BDD and/or SOLID Principles in Clean Code (or Onion) Architectures / N-Tier Designs involve breaking up your application code into various types of projects such as Core, Infrastructure, Services, UI, etc. These architectures decouple abstractions using dependency injections that are typically split in separate library projects. These types of abstractions make large code bases more testable, maintainable, and stable as it grows over time. While these projects could be split into separate dedicated solutions, the development and debugging experience is significantly improved when multiple, related projects (in active development) exist in the same solution. Services can be split into their own solutions with core projects, as well as common projects be found in multiple solutions.
9th Aug 2020, 3:53 AM
David Carroll
David Carroll - avatar
+ 4
Ore That's not a dumb question. 😉 TBH... I'd be surprised if people understood most of the topics I made references to in my response. I'm only scratching the very surface on many concepts in my first response that many developers might not get deep exposure to for several years. A Visual Studio (Community / Pro / Enterprise) solution is a file (*.sln) that uses a XML structure to store path references to related projects with various settings and other meta information used for configuring builds, deployment, debugging, etc, etc.
9th Aug 2020, 1:45 PM
David Carroll
David Carroll - avatar
+ 4
David Carroll Thanks for reassuring me it is not a dumb question 😄
9th Aug 2020, 2:02 PM
Ore
Ore - avatar
+ 3
An application may consist of more than one piece of software! You can have an AWS lambda project that runs in the cloud, backed by a C# ASP.net project that exposes an API, a project containing some cleanup jobs that run every night, some console projects that move data, etc etc.. It can also be a crude way of sharing code, you can have a project in your solution be a dependency of a different project in the same solution. Also common: Unit test projects that contain nothing but tests.
9th Aug 2020, 1:41 AM
Schindlabua
Schindlabua - avatar
+ 3
Ore Download Visual Studio Community Edition, you'll see immediately :P A solution contains projects which contain actual code files. So if you are starting a new project you have to create a new solution for the project to live in, first.
9th Aug 2020, 9:11 AM
Schindlabua
Schindlabua - avatar
+ 2
I have a dumb question: What is a solution? I am confused
9th Aug 2020, 7:07 AM
Ore
Ore - avatar
+ 2
Ore Yeah! Actually, one solution per git repository is usually the way to do it :)
9th Aug 2020, 10:03 AM
Schindlabua
Schindlabua - avatar
+ 1
Schindlabua Like a repository for many related projects?
9th Aug 2020, 9:23 AM
Ore
Ore - avatar
+ 1
Schindlabua Thanks. I get it now😄
9th Aug 2020, 11:19 AM
Ore
Ore - avatar
+ 1
You can include libraries written in any language that is supported by the runtime engine...
10th Aug 2020, 6:14 AM
Sanjay Kamath
Sanjay Kamath - avatar
+ 1
Ketan Lalcheta vb / C# / Managed C++👶
10th Aug 2020, 3:18 PM
Sanjay Kamath
Sanjay Kamath - avatar
+ 1
CSS / JS / CS Files all in one solution in VS
10th Aug 2020, 4:42 PM
Sanjay Kamath
Sanjay Kamath - avatar
0
Could you please elaborate on this Sanjay Kamath
10th Aug 2020, 3:16 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Do you mean I can include vb code library into c++ code? Don't we need some function mangling and all to use library functions ?
10th Aug 2020, 3:21 PM
Ketan Lalcheta
Ketan Lalcheta - avatar