Udostępnij za pośrednictwem


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 Project 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.

Warning

Selecting projects on the Depends on pane 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 How to: Create and Remove Project Dependencies and How to: Create 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 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

Tasks

How to: Edit Common Properties for Solutions

How to: Prepare and Manage Builds

Concepts

Item Management in Projects

Build Configurations

Projects as Containers

Reference

Configuration, Configuration Properties, Solution Property Pages Dialog Box

Other Resources

Solution Property Pages Dialog Box

Building in Visual Studio