Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any best practices for Visual Studio Project/Solution Structure?

I've seen a lot of different takes on this subject so I figured if there's a preferred way on this.

Is there any best practices on how to setup Visual Studio Projects and Solutions in regards to multiple solutions for the same solutions?

For example: Let's say I have a task that calls for a web app, a console application, and a shared business logic library.

I have seen this situation in a 1, 2, and 3 solutions at some time in my career. This is a simple example; however, what if number of projects grows? Is there a line when to keep it in one or break it apart?

like image 520
JamesEggers Avatar asked Nov 12 '08 18:11

JamesEggers


People also ask

What is the difference between project and solution in Visual Studio?

A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.

Should I put project and solution same folder?

For multiproject solutions, having the directory structure reflect the solution structure usually makes more sense—it is best to have a directory that contains your solution file, with subdirectories for each individual project.

What is the purpose of Solution Explorer in Visual Studio?

Solution Explorer is a special window that enables you to manage solutions, projects, and files. It provides a complete view of the files in a project, and it enables you to add or remove files and to organize files into subfolders.

What is a solution Visual Studio?

In Visual Studio, a solution isn't an "answer". A solution is simply a container Visual Studio uses to organize one or more related projects. When you open a solution, Visual Studio automatically loads all the projects that the solution contains.


2 Answers

Indeed, there are some guidelines for this sort of setup on MSDN. I wrote a short summary in my answer to a similar question on StackOverflow.

like image 160
Greg D Avatar answered Sep 20 '22 15:09

Greg D


I blogged about this back in 2007. The advice still holds:

http://mikehadlow.blogspot.com/2007/07/how-to-structure-visual-studio.html

The bottom line is that I should be able to get your code out of source control, open it in Visual Studio, hit F5 and everything should work.

like image 34
Mike Hadlow Avatar answered Sep 19 '22 15:09

Mike Hadlow