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 _
) 
[C++]
HRESULT __stdcall AddConfiguration(
   BSTR ConfigurationName
);
[C#]
public void AddConfiguration(
   string ConfigurationName
);
[JScript .NET]
public function AddConfiguration(
   ConfigurationName : String
)

Parameters

ConfigurationName
Required. The configuration name.

Remarks

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.

Example

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
        prj.AddConfiguration("addedConfig")
    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

Show: