Export (0) Print
Expand All

How to: Create Multi-Project Solutions 

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.

Thus, the framework for the physical association of your solution's files is established during the creation of a file or project.

The benefits of an orderly file structure that accurately reflects the relationships between their files and projects are readily apparent, 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 bearing their names. For more information, see How to: Create Directories for Solutions and Item Management in Projects.

NoteTip

You can more easily share numerous and related source-controlled projects by creating them under a common solution directory.

To create a root solution for multiple local projects

  1. On the File menu, choose New and then choose Project.

  2. In the New Project dialog box, select one of the Project Types from the left pane.

  3. Select one of the project Templates from the right pane.

  4. Type a project Name.

    NoteNote

    For some project types, the Name textbox is unavailable because specifying the location sets the project name. For example, Web applications and XML Web Services are located on a Web server and derive their name from the virtual directory specified on that server.

  5. In the Solution list, click Create new Solution (if one is already open).

  6. Select Create Directory for Solution.

  7. In the Name textbox for the solution, give your solution a unique name (usually different from the project Name).

    NoteTip

    When you create multi-project solutions containing Web projects, establish a Solution directory by first creating a Blank Solution and subsequently adding projects to it.

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, choose Add and then choose New Project.

  3. Select a Project Type and Template.

You can add an existing project to a solution 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, choose Add and then choose Existing Project.

  3. Find and select the project you want to add to the solution.

Deleting Solutions

You can delete an entire solution permanently, but not by using Visual Studio. Instead, use Windows Explorer to delete the directory that contains the two solution files: .sln and .suo. Before you delete a solution, move any projects that you might want to use again in another solution.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft