SolutionBuild2 Interface
TOC
Collapse the table of content
Expand the table of content

SolutionBuild2 Interface

 

Represents the root of the build automation model at the solution level.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

[GuidAttribute("C2516E4B-5D69-459D-B539-C95A71C4FA3D")]
public interface SolutionBuild2 : SolutionBuild

NameDescription
System_CAPS_pubpropertyActiveConfiguration

Gets the currently active SolutionConfiguration object.

System_CAPS_pubpropertyBuildDependencies

Gets a BuildDependencies collection that allows you to specify which projects depend on which other projects.

System_CAPS_pubpropertyBuildState

Gets whether a build has ever been started in the current environment session, whether a build is currently in progress, or whether a build has been completed.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyLastBuildInfo

Gets the number of projects that failed to build.

System_CAPS_pubpropertyLastPublishInfo

Gets the number of items that were successfully published.

System_CAPS_pubpropertyParent

Gets the immediate parent object of a SolutionBuild object.

System_CAPS_pubpropertyPublishState

Gets the state of a publish operation.

System_CAPS_pubpropertySolutionConfigurations

Gets a collection of SolutionConfiguration objects.

System_CAPS_pubpropertyStartupProjects

Gets or sets the names of projects that are entry points for the application.

NameDescription
System_CAPS_pubmethodBuild(Boolean)

Causes the active solution configuration to begin building.

System_CAPS_pubmethodBuildProject(String, String, Boolean)

Builds the specified project and its dependencies in the context of the specified solution configuration.

System_CAPS_pubmethodClean(Boolean)

Deletes all compiler-generated support files for marked projects.

System_CAPS_pubmethodDebug()

Starts debugging the solution.

System_CAPS_pubmethodDeploy(Boolean)

Causes each project in the active solution configuration that is marked for deployment to deploy.

System_CAPS_pubmethodDeployProject(String, String, Boolean)

Deploys a project.

System_CAPS_pubmethodPublish(Boolean)

Initiates a publish operation.

System_CAPS_pubmethodPublishProject(String, String, Boolean)

Publishes a project.

System_CAPS_pubmethodRun()

Causes the active solution configuration to execute.

The SolutionBuild object provides access to all solution configurations and their properties, the project build dependencies, and startup projects.

The counterpart to the SolutionBuild object at the project and item level is the ConfigurationManager object.

This example sets the first solution configurations item to "release" and then builds the solution. Open a project in the Visual Studio integrated development environment (IDE) before running this example.

using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void SolutionBuild2BuildExample(DTE2 dte)
{
    try
    {
        Solution2 soln = (Solution2)_applicationObject.Solution;
        SolutionBuild2 sb;
        BuildDependencies bld;
        // Open a solution in Visual Studio before 
        // running this example.
        sb = (SolutionBuild2)soln.SolutionBuild;
        bld = sb.BuildDependencies;
        MessageBox.Show("The project " + bld.Item(1).Project.Name 
+ " has " + bld.Count.ToString() + " build dependencies.");
        MessageBox.Show("Set the configuration to release 
and build...");
        sb.SolutionConfigurations.Item("Release").Activate();
        sb.Build(true);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}
Return to top
Show:
© 2016 Microsoft