Partager via


Project.ConfigurationManager Property

Definition

Gets the ConfigurationManager object for this Project .

public:
 property EnvDTE::ConfigurationManager ^ ConfigurationManager { EnvDTE::ConfigurationManager ^ get(); };
[System.Runtime.InteropServices.DispId(213)]
public EnvDTE.ConfigurationManager ConfigurationManager { [System.Runtime.InteropServices.DispId(213)] get; }
[<System.Runtime.InteropServices.DispId(213)>]
[<get: System.Runtime.InteropServices.DispId(213)>]
member this.ConfigurationManager : EnvDTE.ConfigurationManager
Public ReadOnly Property ConfigurationManager As ConfigurationManager

Property Value

A ConfigurationManager object.

Attributes

Examples

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

Remarks

The ConfigurationManager object represents the project configurations for a project or project item. A project configuration name and platform name uniquely identify each project configuration.

Applies to