Partager via


SolutionBuild.ActiveConfiguration, propriété

Obtient l'objet SolutionConfiguration actif.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
ReadOnly Property ActiveConfiguration As SolutionConfiguration
    Get
SolutionConfiguration ActiveConfiguration { get; }
property SolutionConfiguration^ ActiveConfiguration {
    SolutionConfiguration^ get ();
}
abstract ActiveConfiguration : SolutionConfiguration
function get ActiveConfiguration () : SolutionConfiguration

Valeur de propriété

Type : EnvDTE.SolutionConfiguration
Objet SolutionConfiguration.

Notes

L'objet SolutionConfiguration représente la configuration de solution en cours à utiliser en cas d'opération de génération de solution.

Exemples

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);
    }
}

Sécurité .NET Framework

Voir aussi

Référence

SolutionBuild Interface

EnvDTE, espace de noms