This documentation is archived and is not being maintained.

AddConfiguration Method

Visual Studio .NET 2003

Adds a configuration to the current project.

[Visual Basic .NET]
Public Sub AddConfiguration( _
   ConfigurationName As String _
[Visual Basic 6]
Sub AddConfiguration( _
   ConfigurationName As String _
HRESULT __stdcall AddConfiguration(
   BSTR ConfigurationName
public void AddConfiguration(
   string ConfigurationName
[JScript .NET]
public function AddConfiguration(
   ConfigurationName : String


Required. The configuration name.


The Configurations property lets you see which configurations are on the current project.

To have this configuration be useful, you will want to call VCConfiguration::CopyTo to copy basic settings from an existing config into the new config. Otherwise, you will need to set even the most rudimentary options yourself.


The following sample code uses the AddConfiguration property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfg As VCConfiguration
        prj = DTE.Solution.Projects.Item(1).Object
    End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCProject Object