Visual Studio Project vs. Solution

前端 未结 10 2168
被撕碎了的回忆
被撕碎了的回忆 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:14

    Solutions are containers used by Visual Studio to organize one or more related projects. When you open a solution in Visual Studio, it will automatically load all the projects it contains.

    When you create a new project in Visual Studio, it automatically creates a solution to house the project if there's not a solution already open.

    You can set dependencies of projects on other projects in the solution. The dependent project is build after the project it is depending on is built.

    For more details refer - https://docs.microsoft.com/en-us/visualstudio/ide/quickstart-projects-solutions

    If you are from an Eclipse background you would probably go to build path of a project and add a dependency on other project or add an external jar. In VS you can do that in a single container called solution where all related projects are grouped together.

    Eg. Let's say you are build and android and iOS app in xamrin, there would be some common code and resources that could go in a separate project and then your android and iOS projects can depend on this common code project. Also you could have projects to test these projects etc.

提交回复
热议问题