Bagikan melalui


How to: Create Multi-Project Solutions

Any solution can contain one or more projects. Multi-project solutions are created by adding projects to existing solutions. For more information on creating solutions, see How to: Create Solutions and Projects.

Solutions are created under these circumstances:

  • A new file is added to an empty solution.

  • A project is added to an empty Solution Explorer.

  • A blank solution is added from the Other Project Types, Visual Studio Solutions node of the New Project dialog box.

The framework for the physical association of your solution's files is established when a file or project is created.

In a multi-project solution, an orderly file structure that accurately reflects the relationships between projects and their files is helpful throughout the development cycle, especially for larger projects. For all projects, you can establish a root solution directory where all local files are saved and all projects are, by default, created in folders that bear their names. For more information, see How to: Create Directories for Solutions and Item Management in Projects.

Note

You can more easily share many related source-controlled projects by creating them in a common solution directory.

Adding Projects to a Solution

You can add either a new project or an existing project to a solution.

To add a new project to a solution

  1. In Solution Explorer, select the solution or the solution folder that you want to add a project to.

  2. On the File menu, point to Add and then click New Project.

  3. Select a Project Type and Template.

You can add an existing project to a solution and then edit that project to meet the requirements of the current solution.

To add an existing project to a solution

  1. In Solution Explorer, select the solution or the solution folder that you want to add a project to.

  2. On the File menu, point to Add and then click Existing Project.

  3. Select the project you want to add to the solution.

Note

The Add/New Project and Add/Existing Project commands can also be accessed by right-clicking the solution in Solution Explorer.

Deleting Solutions

You can delete an entire solution permanently, but not by using Visual Studio.  

To delete a solution permanently

  1. Before you delete the solution, move any projects that you might want to use again.

  2. Use Windows Explorer to delete the directory that contains the two solution files, .sln and .suo.

See Also

Tasks

How to: Create Directories for Solutions

How to: Create Solutions and Projects

Reference

New Project Dialog Box

Add New Project Dialog Box

Change History

Date

History

Reason

July 2008

Replaced procedure for creating a solution with topic link. Added clarifying notes. Updated UI text.

Customer feedback.