SolutionBuild.ActiveConfiguration 属性

定义

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

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

属性值

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

注解

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

适用于