SolutionBuild.ActiveConfiguration 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前处于活动状态的 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
属性值
- 属性
示例
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对象表示将在解决方案生成操作发生时使用的当前解决方案配置。