Partager via


VCConfiguration.CopyTo Method

Copies the current configuration.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Déclaration
Sub CopyTo ( _
    Config As Object _
)
void CopyTo(
    Object Config
)
void CopyTo(
    Object^ Config
)
abstract CopyTo : 
        Config:Object -> unit 
function CopyTo(
    Config : Object
)

Parameters

  • Config
    Type: System.Object
    Required. The configuration into which you want to copy the current configuration's settings.

Remarks

This method is useful when you have added a configuration and want to copy the settings from an existing configuration to the new configuration.

Examples

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

The following example invokes the CopyTo 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 cfgs As IVCCollection
        Dim cfg, Dest As VCConfiguration
        Dim Dest_obj As Object
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item("Debug")
        Dest = cfgs.Item("Release")
        Dest_obj = Dest
        cfg.CopyTo(Dest_obj)
    End Sub
End Module

.NET Framework Security

See Also

Reference

VCConfiguration Interface

Microsoft.VisualStudio.VCProjectEngine Namespace