How to: Create Solution and Project Build Configurations
Visual Studio add-ins are deprecated in Visual Studio 2013. You should upgrade your add-ins to VSPackage extensions. For more information about upgrading, see FAQ: Converting Add-ins to VSPackage Extensions.
The Visual Studio automation model offers objects that enable you to control solution and project build configurations. A solution build configuration specifies how certain projects in a solution are to be built and, if enabled, deployed. Project build configurations, which are listed in the Project Property Pages dialog box, list all available types of project builds, such as Debug or Release, and the available platforms, such as .NET or Win32. For each combination of build and platform, there is a project configuration — a set of defined project properties and settings.
The solution build configuration objects are:
|
Object Name |
Description |
|---|---|
|
SolutionBuild2 object |
Used to build, clean, and deploy the currently active solution configuration. |
|
SolutionConfiguration2 object |
Represents a list of projects and their configurations that are to be built. |
|
SolutionConfigurations collection |
Contains all defined SolutionConfiguration objects. |
|
SolutionContext object |
Represents a project's configuration in a SolutionConfiguration object. |
|
SolutionContexts collection |
Contains all SolutionContext objects in a SolutionConfiguration object. |
|
BuildDependency object |
Represents a project that must be built before the owning project can be built. |
|
BuildDependencies collection |
Contains all projects that must be built before the owning project can be built. |
The project build configuration objects are:
|
Object Name |
Description |
|---|---|
|
ConfigurationManager object |
Represents build configuration and platforms. |
|
Configuration object |
Represents a configuration, or set of build settings, within a specified platform. |
|
Configurations collection |
Contains all Configuration objects. |
|
OutputGroup object |
Contains the files that are built by the project. |
|
OutputGroups collection |
Contains all OutputGroup objects. |
Using these objects you can:
-
Create, add projects to, activate, and delete solution configurations.
-
Build, run, or deploy any project in a solution configuration.
-
Obtain information about objects within a project or solution configuration.
-
Add, remove, or get information about project build dependencies.
Note
|
|---|
|
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. These procedures were developed with the General Development Settings active. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Customizing Development Settings in Visual Studio. |
To compile this code, create a new Visual Studio Add-in project and replace the code of the Connect.cs or Connect.vb class with the code in the example. Before running the add-in, open a project in the Visual Studio IDE. For information about how to run an add-in, see How to: Control Add-Ins By Using the Add-In Manager.
Note