ConfigurationManager::AddConfigurationRow Method (String^, String^, Boolean)
Visual Studio 2015
Creates a new project or project item configuration row based on the Configuration object of an existing project or project item configuration row.
Assembly: EnvDTE (in EnvDTE.dll)
Configurations^ AddConfigurationRow(
String^ NewName,
String^ ExistingName,
bool Propagate
)
Parameters
- NewName
-
Type:
System::String^
Required. A unique name for the new project or project item configuration row.
- ExistingName
-
Type:
System::String^
Required. The name of the project or project item configuration row to copy in order to create the new one.
- Propagate
-
Type:
System::Boolean
Required. true if the project or project item configuration row should be propagated, false if not.
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.
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
Show: