Creating a Multiproject Solution

Each project you create is contained within a solution, and a solution can contain multiple projects.

Note   Before you use the following procedure to create a multiproject solution, close any projects that you may already have open. (On the File menu, click Close All.)

To create the first project in the solution

  1. On the File menu, click New Project.

  2. On the New tab, expand the Visual J++ Projects folder and click Applications. Then select the Windows Application icon.

  3. In the Name box, enter a name for your project.

  4. In the Location box, enter the path where you want to save your project, or click Browse to navigate to the folder.

  5. Click Open. A collapsed view of the project appears in .

Note   Because no project (or solution) was open when you created the Windows application project, the new project is created in a new solution.

To add another project to the solution

  1. With the first project open, click New Project on the File menu.

  2. On the New tab, expand the Visual J++ Projects folder and click Web Pages. Then select the Code-Behind HTML icon.

  3. In the Name box, enter a name for your project.

  4. In the Location box, enter the path where you want to save your project, or click Browse to navigate to the folder.

  5. Because there is a solution that is currently open, you have two options:

    • Close current solution   Closes the current solution and creates the project in a new solution.

    • Add to current solution   Keeps the current solution open and simply adds the new project to it.

  6. Select the Add to current solution option and click Open. A collapsed view of the project appears in .

For more information about the different types of projects you can create in Visual J++, see Creating Projects.

Building a Multiproject Solution

When you create a multiproject solution, you can build either a single project within the solution or all projects in the solution.

To build a single project in the solution

  1. In Project Explorer, select the name of the project you want to build.

  2. On the Build menu, click BuildProjectName.

To build all projects in the solution

  • On the Build menu, click Build Solution.

When you build the entire solution, typically each project is built in the order that it was added to the solution. However, if one project depends on another project to be built first, you can explicitly change the build order.

To change the build order of the projects in the solution

  1. In Project Explorer, right-click the name of the solution and click Property Pages on the shortcut menu.

  2. The Build Order tab in the Property Pages dialog box displays the current build order. To change the order of a project, select the project name and click one of the Move buttons.

  3. Click OK when you have finished changing the build order of the projects.

Setting the Startup Project

When you create a multiproject solution, the first project that was added is set as the startup project, and appears in bold font in Project Explorer. The startup project is the project that runs when you click Start on the Debug menu.

To change the startup project

  1. In Project Explorer, right-click the project that you want to set as the startup project.

  2. On the shortcut menu, click Set as Startup Project.