Share via


Configuration.IsBuildable-Eigenschaft

Ruft ab, ob die Konfiguration für das Projekt bzw. das Projektelement erstellt werden kann.

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

Syntax

'Declaration
ReadOnly Property IsBuildable As Boolean
    Get
bool IsBuildable { get; }
property bool IsBuildable {
    bool get ();
}
abstract IsBuildable : bool
function get IsBuildable () : boolean

Eigenschaftswert

Typ: System.Boolean
Ein boolescher Wert, der true lautet, wenn ein Projekt oder Projektelement erstellt werden soll, und andernfalls false.

Hinweise

Wenn Sie angeben möchten, dass ein Projekt oder Element erstellt werden soll, geben Sie es in SolutionContext als die Konfiguration an, die Kontext enthält und zum Erstellen für eine bestimmte Projektmappenkonfiguration verwendet werden soll.

Beispiele

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        Project prj;
        Configuration config;
        if (dte.Solution.Projects.Count > 0)
        {
            prj = dte.Solution.Projects.Item(1);
            config = prj.ConfigurationManager.ActiveConfiguration;
            // Determine and show whether the active configuration is buildable.
            MessageBox.Show(config.IsBuildable.ToString());
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Configuration Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell