次の方法で共有


VCProject.AddConfiguration(String) Method

Definition

Adds a configuration to the current project.

public:
 void AddConfiguration(System::String ^ ConfigurationName);
public:
 void AddConfiguration(Platform::String ^ ConfigurationName);
void AddConfiguration(std::wstring const & ConfigurationName);
[System.Runtime.InteropServices.DispId(805)]
public void AddConfiguration (string ConfigurationName);
[<System.Runtime.InteropServices.DispId(805)>]
abstract member AddConfiguration : string -> unit
Public Sub AddConfiguration (ConfigurationName As String)

Parameters

ConfigurationName
String

Required. The configuration name.

Attributes

Examples

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

The following example uses the AddConfiguration method in the integrated development environment (IDE):

' 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  

Remarks

The Configurations property returns the configurations that are on the current project.

To have this configuration be useful, you must call the CopyTo method to copy basic settings from an existing configuration to the new configuration. Otherwise, you must set even the most rudimentary options yourself.

Applies to