Visual Studio Project and Solution

Being new to VS, how can I think of these two concepts, what is the difference?

+63
visual-studio projects-and-solutions solution
Mar 05 '10 at 19:07
source share
8 answers

The solution is a container for projects and tracks dependencies between projects.

+42
Mar 05 '10 at 19:08
source share

I find the missing information in other answers (at least for people who come from other IDEs like Eclipse). To say that a solution is a container for projects is only part of this thing. The conceptual feature of the VS project (which determines its “granularity”) is that one project produces one output : usually an executable file or a library (dll). So, if you are going to encode three executables that use the associated code, you will create one solution and at least three projects - possibly more.

+87
May 30 '11 at 20:16
source share

Just to come up with a metaphor.

The solution is like a house, a project similar to a room. Each room has functionality, while a house, a container with rooms, provides facilities for connecting rooms and organizing them properly.

Something banal, but I did it all on the fly, so bear with me :)

+28
Mar 05 '10 at 7:11
source share

This doesn't help Visual Studio, it seems to make things more confusing. A “new project” actually creates a new solution containing the project. An “open project” actually opens a solution containing one (or many) projects. (The file menu says "Open Project / Solution", but it really opens up the solution. The exact "Close Project" is not "Close Solution".

So, in VS you always work as part of a solution. Many solutions contain only one project, and newer developers probably think of them as the same. However, you can add other projects to the solution.

+12
Sep 17 '15 at 15:50
source share

A solution can have many projects.

The solution can also handle dependency management between its various projects ... making sure that each project will be created in the appropriate order for the final solution.

+3
Mar 05 '10 at 19:08
source share

The project contains executable and library files that make up the application or application component.

The solution is a placeholder for the logically connected projects that make up the application. For example, you may have separate projects for the graphical interface of the application, the level of access to the database, etc. Projects would be specific units for your program functionality, and a solution would be an umbrella integrating all of them into one application.

+3
Mar 05 '10 at 7:15
source share

Solutions are containers for projects - you can also use them to organize elements that are used in different related projects (common dll, etc.).

+2
Mar 05 '10 at 19:09
source share

In case someone decides to scroll down so far ... I thought MS docs did a good job of describing the differences. I copied the corresponding bit here:

When creating an application, application, website, web application, script, plugin, etc. in Visual Studio, you start with a project. In a logical sense, a project contains all the source code files, icons, images, data files, and everything else that will be compiled into an executable program or website, or is necessary to complete the compilation. The project also contains all the compiler options and other configuration files that may be required by the various services or components with which your program will interact. Note

You have no solutions or projects if you do not want to. You can simply open the files in Visual Studio and start editing your code.

In a literal sense, a project is an XML file (.vbproj, .csproj, * .vcxproj) that defines the hierarchy of virtual folders, as well as the path to all the elements it contains and all the build settings. In Visual Studio, the project file is used by Solution Explorer to display the contents and settings of the project. When you compile your project, the MSBuild engine consumes the project file to create the executable. You can also set up projects to display other types of products.

A project is contained in a logical sense and in the file system as part of a solution that can contain one or more projects, as well as assembly information, Visual Studio window options and any different files that are not associated with any project. In a literal sense, the solution is a text file with its own unique format; it is usually not intended for manual editing.

The solution has an associated * .suo file, which stores settings, settings and configuration information for each user working on the project.

+1
Jun 01 '17 at 23:09 on
source share



All Articles