共用方式為


Project.ConfigurationManager 屬性

取得這個 ProjectConfigurationManager 物件。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property ConfigurationManager As ConfigurationManager
ConfigurationManager ConfigurationManager { get; }
property ConfigurationManager^ ConfigurationManager {
    ConfigurationManager^ get ();
}
abstract ConfigurationManager : ConfigurationManager with get
function get ConfigurationManager () : ConfigurationManager

屬性值

類型:EnvDTE.ConfigurationManager
ConfigurationManager 物件。

備註

ConfigurationManager物件都代表專案組態的專案或專案項目。 專案組態名稱與平台名稱可唯一識別每個專案組態。

範例

Sub ConfigurationManagerExample(ByVal dte As DTE2)

    ' Before running this sample, open a project.

    Dim proj As Project = dte.Solution.Item(1)
    Dim manager As ConfigurationManager = proj.ConfigurationManager

    ' Define a new Debug-based configuration for the project.
    Dim configs As Configurations = _
        manager.AddConfigurationRow("MyDebug", "Debug", False)
    Dim config As EnvDTE.Configuration
    Dim msg As String

    ' List all build configurations for the project.
    For Each config In configs
        msg &= config.ConfigurationName
    Next

    MsgBox(proj.Name & " defines the following build configurations:" _
        & vbCrLf & vbCrLf & msg)

End Sub
public void ConfigurationManagerExample(DTE2 dte)
{
    // Before running this sample, open a project.

    Project proj = dte.Solution.Item(1);
    ConfigurationManager manager = proj.ConfigurationManager;

    // Define a new Debug-based configuration for the project.
    Configurations configs = 
        manager.AddConfigurationRow("MyDebug", "Debug", false);
    string msg = "";

    // List all build configurations for the project.
    foreach (EnvDTE.Configuration config in configs)
        msg += config.ConfigurationName;

    MessageBox.Show(proj.Name + 
        " defines the following build configurations:\n\n" + msg);
}

.NET Framework 安全性

請參閱

參考

Project 介面

EnvDTE 命名空間

其他資源

如何:編譯和執行 Automation 物件模型程式碼範例