Share via


Project Dependencies, Common Properties, Solution Property Pages Dialog Box

When building a solution, it can be necessary to build certain projects first, to generate executable code used by other projects. Use the Project Dependencies, Common Properties, Solution Property Pages dialog box to set the current build order. To access this dialog box, select a solution in Solution Explorer, choose Property Pages on the View menu, and then select Project Dependencies under Common Properties.

Dependencies

The Dependencies options page makes it possible for you to determine which projects in the selected solution must be built first. Setting project dependencies stipulates the desired build order for projects.

  • Project
    Select any project from this drop-down list that consumes executable code generated by another project.
  • Depends on
    Select the check box beside any project that generates executable code consumed by the project indicated in the Project drop-down list. The build order of projects not selected is not constrained by the project in the drop-down list.

Before building a solution, confirm that all project dependencies have been selected in the Configuration Manager dialog box to be built by the active solution build configuration. For more information, see Configuration Manager Dialog Box.

Caution   Selecting projects on the Dependencies tab of the Project Dependencies dialog box does not guarantee that all projects selected will be built. Only those projects whose Build check boxes are selected in the active solution build configuration are actually built.

Dependencies in the Project Dependencies Dialog Box

You also can access Dependencies settings from the Project Dependencies Dialog Box. To access this dialog box, select a project in the Solution Explorer, and then choose Project Dependencies from the Project menu. The Project Dependencies dialog box presents two tabbed panes, Dependencies and Build Order. Changes made in the Project Dependencies, Common Properties, Solution Property Pages dialog box are reflected on the Dependencies tab, and vice versa. For more information, see Creating and Removing Project Dependencies and Creating Solution and Project Build Configurations.

About Project Dependencies

When a project consumes executable code generated by another project, the project that generates the code is referred to as a project dependency of the project that consumes the code. Whenever a project dependency has not been built or has been modified since the most recent build, that project is built first, to generate and update the code to be consumed.

For example, if project B requires executable code generated by its project dependency project A, and you have modified project A since the last build, then project A is rebuilt before project B is built. This makes it possible for the executable code provided by project A to be revised before project B consumes it.

If project A has not been modified since the last build, then a fresh rebuild of project A is not needed. Only project B is built.

Projects can appear dimmed on the Dependencies list with their check boxes cleared. These projects cannot be checked because doing so would create a loop of dependencies (P1 dependent upon P2, P2 ** dependent upon P1) and stall the build.

Projects also can appear dimmed on the Dependencies list with their check boxes selected. These projects have been added by the integrated development environment (IDE) and cannot be changed. For example, adding a project reference from a Visual Basic project to another project automatically adds a build dependency that can only be removed by deleting the reference.

See Also

Editing Common Properties for Solutions | Solution Property Pages Dialog Box | Item Management in Projects | Configuration, Configuration Properties, Solution Property Pages Dialog Box | Preparing and Managing Builds | Default and Custom Builds | Build Configurations | Projects as Containers