954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Why have multiple projects in a solution

As I dig deeper into the capabilities of Visual Studio, I have seen that you can have multiple projects in a single solution. I must be missing something because I can't come up with a reason to ever do this? My guess is that I don't understand the benefit. So, I thought I would pose the question to my fellow developers and ask for some real world situations where you had multiple projects in one solution, the benefit obtained, and at a high level, what each project did and why they needed linked into one solution. Also, were they all exes, dlls, etc.?

Thanks in advance for your input.

Smith5646
Junior Poster in Training
65 posts since Nov 2009
Reputation Points: 34
Solved Threads: 9
 

Have a look at MSDN article - Solution (.Sln) File

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 
Have a look at MSDN article - Solution (.Sln) File

This tells me how and some benefits, which went right over my head right now, probably because I'm still missing the why. Everything I have built has been one solution / one project. Why would you have multiple projects in one solution and what would be in each of them. Please give details such as the solution was to do xxx, project 1 did yyy and project 2 did zzz.

Smith5646
Junior Poster in Training
65 posts since Nov 2009
Reputation Points: 34
Solved Threads: 9
 

>I must be missing something because I can't come up with a reason to ever do this?

What we need is a pragmatic approach. Have a look at some good open source projects at http://www.codeplex.com/

>where you had multiple projects in one solution, the benefit obtained, and at a high level

It is nearly impossible for me to put all kind of programming work in a single project. For example, I've windows-app (database) project. My project includes - database schema and object design, model classes, some custom controls, and of course testing(unit-test). All these activities need a separate project definition. So, database and model classes are developed in database project and library project respectively and code will tested in unit-test projects. User-Interface (custom controls) project contains custom control classes which I want to use them on windows-app.

After few days I've been told that they (my client) are also interested in web-app and without any hesitation I've said OK! (I've added another web-project in my current solution).


For more information on Solution or Project Container read following articles:

1. Introduction to Solutions, Projects, and Items
2. Solutions as Containers (Advantages)

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

I wanted to post a follow up now that I finally got to have a conversation with someone that does this for a living.

Many of his projects in a solution create DLLs that are used used by the EXE. He also explained that if the solution has multiple projects that generate EXEs, even though pressing the F5 to debug will only run the primary EXE, when the solution is published, it will generate multiple EXEs. There is also a way to switch which EXE is primary for debugging purposes but I need to do additional research to find out where to change it.

I hope this additional information helps the next person trying to figure this out.

Smith5646
Junior Poster in Training
65 posts since Nov 2009
Reputation Points: 34
Solved Threads: 9
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You