Export (0) Print
Expand All

ConfigurationManager.AddConfigurationRow Method

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

Namespace:  EnvDTE
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.

Return Value

Type: EnvDTE.Configurations
A Configurations collection.

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:
© 2014 Microsoft