SolutionBuild2.ActiveConfiguration Eigenschaft

Definition

Ruft das aktuell aktive SolutionConfiguration-Objekt ab.

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

Eigenschaftswert

SolutionConfiguration

Ein SolutionConfiguration-Objekt.

Implementiert

Attribute

Beispiele

In diesem Beispiel wird der Buildstatus für jede aktive Startkonfiguration bestimmt. Öffnen Sie ein Projekt in der Visual Studio integrierten Entwicklungsumgebung (Integrated Development Environment, IDE), bevor Sie dieses Beispiel ausführen.

Imports EnvDTE  
Imports EnvDTE80  
Sub SolutionBuild2Example(ByVal dte As DTE2)  
    ' Open a solution in the Visual Studio IDE  
    ' before running this example.  
    Try  
        Dim sb As SolutionBuild2  
        sb = CType(_applicationObject.Solution.SolutionBuild _        , SolutionBuild2)  
        Dim sc As SolutionConfiguration2  
        sc = CType(sb.ActiveConfiguration, SolutionConfiguration2)  
        Dim vsBldSt As vsBuildState  
        Dim msg As String = "Return relative path to startup  _  
        projects: "  
        For Each s As String In CType(sb.StartupProjects, Array)  
            msg &= vbCr & " " & s  
        Next  
        msg &= vbCr & "SolutionConfiguration: " & sc.Name  
        vsBldSt = sb.BuildState  
        If (vsBldSt = vsBuildState.vsBuildStateDone) Then  
            msg &= vbCr & "A build has occured."  
        ElseIf (vsBldSt = vsBuildState.vsBuildStateInProgress) Then  
            msg &= vbCr & "A build is in progress."  
        Else : msg &= vbCr & "A build has not occurred."  
        End If  
        MsgBox(msg)  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void SolutionBuild2Example(DTE2 dte)  
{  
    try  
    {  
        SolutionBuild2 sb =  
 (SolutionBuild2)_applicationObject.Solution.SolutionBuild;  
        SolutionConfiguration2 sc =  
 (SolutionConfiguration2)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);  
    }  
}  

Hinweise

Das- SolutionConfiguration Objekt stellt die aktuelle Projektmappenkonfiguration dar, die bei einem projektmappenbuildvorgang verwendet wird.

Gilt für