Creating a Multiproject Solution
See Also
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
-
On the File menu, click New Project.
-
On the New tab, expand the Visual J++ Projects folder and click Applications. Then select the Windows Application icon.
-
In the Name box, enter a name for your project.
-
In the Location box, enter the path where you want to save your project, or click Browse to navigate to the folder.
-
Click Open. A collapsed view of the project appears in Project Explorer.
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
-
With the first project open, click New Project on the File menu.
-
On the New tab, expand the Visual J++ Projects folder and click Web Pages. Then select the Code-Behind HTML icon.
-
In the Name box, enter a name for your project.
-
In the Location box, enter the path where you want to save your project, or click Browse to navigate to the folder.
-
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.
-
Select the Add to current solution option and click Open. A collapsed view of the project appears in Project Explorer.
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
-
In Project Explorer, select the name of the project you want to build.
-
On the Build menu, click Build ProjectName.
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
-
In Project Explorer, right-click the name of the solution and click Property Pages on the shortcut menu.
-
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.
-
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
-
In Project Explorer, right-click the project that you want to set as the startup project.
-
On the shortcut menu, click Set as Startup Project.