Build configurations provide a way to store multiple versions of solution and project properties. The active configuration can be quickly accessed and changed, allowing you to easily build multiple configurations of the same project.
By default, and projects created with Visual Studio include Debug and Release configurations. Debug configurations are automatically configured for debugging an application, and Release configurations are configured for the final release of an application. For more information, see. You can also create and edit your own custom solution and project configurations to meet the needs of your application. For more information, see .
Two levels of build configurations can be defined in Visual Studio: solution configurations and project configurations.
A solution configuration specifies how the projects in a solution are to be built and (if enabled) deployed. To define a new solution configuration, open theand select New from the Active solution configuration list.
Each entry in a solution configuration includes a project name, a configuration setting, a platform setting, a build setting, and (if enabled) a deploy setting. The combination of solution configuration and solution platform settings chosen determines the project configuration that will be used. For more information on solution platforms, see.
You can create any number of solution configurations, each with a unique name. The Visual Studio integrated development environment (IDE) automatically assigns solution configurations whenever you:
Add a project platform with Create new solution platforms selected.
Add a project configuration with Create new solution configurations selected.
Add a new project that will be deployed on multiple platforms, one of which is new.
Solution configurations also provide general project context information to the IDE. For example, if the active solution configuration specifies that a project will be built for a mobile device, the Toolbox will display only project items that can be used in a mobile device project while you are working on that project.
The project configuration and project platform are used together to specify the properties to use when building the project. A project can have a set of defined project properties for every unique combination of a configuration and platform. Project properties are edited with the Project Designer. Certain panes in the Project Designer contain dropdown lists that indicate the curent project configuration and platform combination.
You can define the configuration-dependent properties in each project configuration as needed. Project properties can be used to determine, for example, which project items will be included in a particular build, what output files will be created, where the output files will be put, and how they will be optimized.
Project configurations can differ considerably. The properties of one project configuration might, for example, specify that its output file be optimized so that the resulting binary occupies the minimum space, while another project might be optimized such that its executable runs at the maximum speed.
Project configurations are not stored by user, but by solution, so that they can be shared by a team. Although project dependencies are configuration-independent, only those projects specified in the active solution configuration will be built.
Changing Solution Configurations
When you build a solution, Visual Studio uses the active solution configuration, which specifies the project configurations to use for each project to be built. You can change the active configuration directly from Solution Configurations drop-down list in the Standard toolbar, or from thedialog box.
If you cannot find solution configuration settings on the Standard toolbar or cannot access the Configuration Manager, you may have Visual Basic developer settings applied. For more information, see.
How the IDE Assigns Project Configurations to be Built
When you create a new solution configuration (rather than copy one that already exists), the IDE determines the default project configurations for the projects it will build using the following selection criteria for each project (evaluated in this order):
The new solution configuration will build a project configuration whose name exactly matches its own. Configuration names are not case sensitive.
If there is no exact name match, the new solution configuration will build a project configuration whose name matches the configuration portion of its name, whether or not the platform portion also matches. (Remember that the naming convention is <configuration name> <platform-name>.)
If there is still no match, the new solution configuration will build the first configuration listed for a project.
How the IDE Assigns Solution Configurations
When you create a project configuration and select Create new solution configurations, the IDE looks for an appropriately named solution configuration to build the project on each platform it supports. In some cases, the IDE will rename existing solution configurations or create new ones.
The IDE determines how to assign solution configurations using the following selection criteria:
If a project configuration does not specify a platform or specifies a single platform, then a solution configuration whose name matches that of the new project configuration will either be found or added. In this case, the name of this default solution configuration does not include a platform name; it takes the form <project configuration name>.
If a project supports multiple platforms, a solution configuration is found or added for each project configuration to build each project on each platform it supports. The name of each solution configuration includes both the project configuration name and the platform name; it takes the form <project configuration name> <platform name>.