I do not understand the concept of Visual Studio projects and solutions

In Eclipse, I have a workspace containing all my projects. Each project is built and compiled separately. The project does not interact with another project.

How does this compare with Visual Studio and the projects / solutions out there?

+7
eclipse visual-studio
source share
8 answers

The VS project is its own entity. It will build and compile on its own. A solution is just a way to contain multiple projects. Projects are not necessarily needed to compile other projects (although they may depend on other projects).

This allows you to conceptually group projects into one large project. For example, you may have a separate testing project. It depends on the code of the actual project and should be stored with the actual project, but it does not have to be in the same exe / dll.

+22
source share

Each VS project builds one EXE or DLL. A solution is simply a collection of related projects.

So, the VS project: Eclipse :: VS project: Eclipse workspace.

+11
source share

Another way to look at this is with a container solution for projects. For most of my work, I create each level as a project as part of the solution, so my tree looks like this:

  • My Web App or Win App
    • Presentation level
      • files ...
    • Business level
      • files ...
    • Data access
      • files

Your mileage may vary.

+2
source share

@ Thomas Owens:

Yes, some (most?) People using Eclipse have more than one workspace. This surprised me the most when I first started using Eclipse, so I am responding here to make this comment more visible.

+1
source share

What might throw you away is this:

In VS2003, everything had a project file and a solution file. If you have a solution with one project, you can open the Solution and see one project. If you open a project, it will try to create a new solution file to contain the project. But web projects and Winform projects had projects and solutions.

In VS2005, this has changed a bit - by default, web projects now no longer have Project files. They received feedback from some web developers who did not like Project files - their thing is that if the file is in a directory, this is part of the application. After the VS2005 was submitted, they received more feedback from developers who liked the presentation of the Project file, so they fixed it. This is the “Website” and “Web Application” in VS2005 (and I can’t remember what it is now).

In addition, in VS2005, if you have a solution open with only one project, you will not see in the solution explorer that there is even a solution at all, you will see only the project (as if it were not in the solution). Only after adding the second project you will see that there is a solution containing both of them.

So, basically you were on the right track — solutions and projects work the same in Visual Studio as in Eclipse, these are just some of the quirks that make things confusing.

+1
source share

The solution has 0 or many projects ...

0
source share

There are too many kinds of web projects in Visual Studio 2008. There are website designs and web application designs, and they limit you in many ways. This is a good example of Microsoft providing too many options instead of focusing on one powerful solution. Even within the “Website Design” setting, there are at least three different ways to compile your application.

0
source share

I found that it is not always visible that the solution in the solution explorer is annoying. In the settings → Projects and Solutions → Generation is called "Always show a solution", which was convenient.

0
source share

All Articles