Partager via


SolutionBuild.ActiveConfiguration Property

Definition

Gets the currently active SolutionConfiguration object.

public:
 property EnvDTE::SolutionConfiguration ^ ActiveConfiguration { EnvDTE::SolutionConfiguration ^ get(); };
public:
 property EnvDTE::SolutionConfiguration ^ ActiveConfiguration { EnvDTE::SolutionConfiguration ^ get(); };
[System.Runtime.InteropServices.DispId(3)]
public EnvDTE.SolutionConfiguration ActiveConfiguration { [System.Runtime.InteropServices.DispId(3)] get; }
[<System.Runtime.InteropServices.DispId(3)>]
[<get: System.Runtime.InteropServices.DispId(3)>]
member this.ActiveConfiguration : EnvDTE.SolutionConfiguration
Public ReadOnly Property ActiveConfiguration As SolutionConfiguration

Property Value

A SolutionConfiguration object.

Attributes

Examples

public void CodeExample(DTE2 dte)  
{    
    try  
    {  
        SolutionBuild sb = dte.Solution.SolutionBuild;  
        SolutionConfiguration sc = sb.ActiveConfiguration;  
        vsBuildState vsBS;  
        string msg = "Return relative path to startup projects: ";  
        foreach (String s in (Array)sb.StartupProjects)  
        {  
            msg += "\n   " + s;  
        }  
        msg += "\nSolutionConfiguration: " + sc.Name;  
        vsBS = sb.BuildState;  
        if (vsBS == vsBuildState.vsBuildStateDone)  
            msg += "\nA build has occurred.";  
        else if (vsBS == vsBuildState.vsBuildStateInProgress)  
            msg += "\nA build is in progress.";  
        else msg += "\nA build has not occurred.";  

        MessageBox.Show(msg);  
    }  
    catch(Exception ex)  
    {  
        MessageBox.Show(ex.Message);  
    }  
}  

Remarks

The SolutionConfiguration object represents the current solution configuration that will be used if a solution build operation occurs.

Applies to