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.

codeorder commented: interesting topic :) +1

Recommended Answers

All 5 Replies

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.

>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)

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.

think of a internet cafe as one solution, the admin program (for you) is one project and the client (for customer) is another project

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.