Visual Studio Project vs. Solution

前端 未结 10 2167
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 18:48

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

10条回答
  •  失恋的感觉
    2020-12-12 19:27

    In case anyone decides to scroll down this far... I thought the MS docs did a pretty good job at describing the differences. I've copy pasted (and rephrased) the relevant bits here:

    When you create an app, application, website, Web App, script, plug-in, etc in Visual Studio, you start with a project. In a logical sense, a project contains of all the source code files, icons, images, data files and anything else that will be compiled into an executable program or web site, or else is needed in order to perform the compilation. A project also contains all the compiler settings and other configuration files that might be needed by various services or components that your program will communicate with.

    You don't have to use solutions or projects if you don't 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 a virtual folder hierarchy along with paths to all the items it "contains" and all the build settings.

    In Visual Studio, the project file is used by Solution Explorer to display the project contents and settings. When you compile your project, the MSBuild engine consumes the project file to create the executable. You can also customize projects to product other kinds of output.

    A project is contained, in a logical sense and in the file system, within a solution, which may contain one or more projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with any project. In a literal sense, the solution is a text file with its own unique format; it is generally not intended to be edited by hand.

    A solution has an associated .suo file that stores settings, preferences and configuration information for each user that has worked on the project.

提交回复
热议问题