ConfigurationManager.ActiveConfiguration 속성

솔루션 빌드 작업이 발생하는 경우 사용할 현재 솔루션 구성을 가져옵니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
ReadOnly Property ActiveConfiguration As Configuration
Configuration ActiveConfiguration { get; }
property Configuration^ ActiveConfiguration {
    Configuration^ get ();
}
abstract ActiveConfiguration : Configuration with get
function get ActiveConfiguration () : Configuration

속성 값

형식: EnvDTE.Configuration
Configuration 개체

설명

활성 솔루션 구성을 변경하려면 Activate 메서드를 사용합니다.

예제

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        ConfigurationManager configmgr;
        Configuration config;
        if (dte.Solution.Projects.Count > 0)
        {
            configmgr = dte.Solution.Projects.Item(1).ConfigurationManager;
            // Return the ActiveConfiguration.
            config = configmgr.ActiveConfiguration;
            // Show how many Configuration objects are in the Configuration Manager.
            MessageBox.Show(configmgr.Count.ToString());
            // Show the name of the application containing this Configuration Manager.
            MessageBox.Show(configmgr.DTE.Name);
            // Show the parent object.
            MessageBox.Show(((Project)configmgr.Parent).Name);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 보안

참고 항목

참조

ConfigurationManager 인터페이스

EnvDTE 네임스페이스