SolutionBuild.ActiveConfiguration 属性

获取当前处于活动状态的 SolutionConfiguration 对象。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property ActiveConfiguration As SolutionConfiguration
SolutionConfiguration ActiveConfiguration { get; }
property SolutionConfiguration^ ActiveConfiguration {
    SolutionConfiguration^ get ();
}
abstract ActiveConfiguration : SolutionConfiguration
function get ActiveConfiguration () : SolutionConfiguration

属性值

类型:EnvDTE.SolutionConfiguration
SolutionConfiguration 对象。

备注

SolutionConfiguration 对象表示将在解决方案生成操作发生时使用的当前解决方案配置。

示例

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

.NET Framework 安全性

请参见

参考

SolutionBuild 接口

EnvDTE 命名空间