ConfigurationManager.AddConfigurationRow(String, String, Boolean) Method

Definition

Creates a new project or project item configuration row based on the Configuration object of an existing project or project item configuration row.

public:
 EnvDTE::Configurations ^ AddConfigurationRow(System::String ^ NewName, System::String ^ ExistingName, bool Propagate);
[System.Runtime.InteropServices.DispId(5)]
public EnvDTE.Configurations AddConfigurationRow (string NewName, string ExistingName, bool Propagate);
abstract member AddConfigurationRow : string * string * bool -> EnvDTE.Configurations
Public Function AddConfigurationRow (NewName As String, ExistingName As String, Propagate As Boolean) As Configurations

Parameters

NewName
String

Required. A unique name for the new project or project item configuration row.

ExistingName
String

Required. The name of the project or project item configuration row to copy in order to create the new one.

Propagate
Boolean

Required. true if the project or project item configuration row should be propagated, false if not.

Returns

Attributes

Examples

Sub AddConfigurationRowExample()  
    ' Make a copy of the "Debug" configurations to temporarily change   
    ' them without affecting the original "Debug" configurations.  
    Dim cfgmgr As ConfigurationManager = _  
        DTE.ActiveSolutionProject.ConfigurationManager  
    Dim cfgs = Cfgmgr.AddConfigurationRow("MyDebug", "Debug")  
    For Each (cfg in cfgs)  
        Cfg.Properties.Item("SomeProperty") = True  
    Next  
End Sub  

Remarks

AddConfigurationRow returns the collection of new Configuration objects. If NewName already exists for this project, then this method fails so that you know that the ExistingName settings were not copied.

Applies to