Export (0) Print
Expand All
Expand Minimize

ProjectConfiguration Property

Visual Studio .NET 2003

The project configuration associated with the selected file configuration.

[Visual Basic .NET]
Public ReadOnly Property ProjectConfiguration() As Object
[Visual Basic 6]
Property Get ProjectConfiguration() As Object
[C++]
HRESULT __stdcall get_ProjectConfiguration(
   /* [out, retval] */ IDispatch** retVal
);
[C#]
public object ProjectConfiguration {get;}
[JScript .NET]
public function get ProjectConfiguration() : Object

Return Value

An object representing the project configuration.

Example

' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This sample displays a message when a project configuration associated 
' with a project reference configuration uses managed C++ extensions.
' Therefore, make sure you have a Visual C++ .NET project loaded before 
' running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module5
    Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference
        Dim projref As VCProjectReference
        Dim refcfg As VCReferenceConfiguration
        Dim projcfg As VCConfiguration

        On Error Resume Next

        ' Loop each project in the solution
        For Each proj In DTE.Solution.Projects
            vcproj = Nothing
            vcproj = CType(proj.Object, VCProject)
            ' If this is a Visual C++ .NET project
            If Not vcproj Is Nothing Then
                ' Loop each reference in the Visual C++ .NET project
                For Each ref In vcproj.VCReferences
                    projref = Nothing
                    projref = CType(ref, VCProjectReference)
                    ' Check to see if this is a project reference
                    If Not projref Is Nothing Then
                        ' Loop all the reference configurations in this 
                        ' project reference
                        For Each refcfg In projref.ReferenceConfigurations
                            ' Get the project configuration associated 
                            ' with this reference configuration
                            projcfg = refcfg.ProjectConfiguration
                            ' Check to see if the project configuration is 
                            ' using managed C++ extensions
                            If projcfg.ManagedExtensions Then
                                MsgBox("The project '" & projref.Name & _
                                  "' referenced by reference '" & _
                                  projref.Name & "' is using managed C++ _
                                  extensions for configuration '" & _
                                  projcfg.Name & "'.")
                            End If
                        Next
                    End If
                Next
            End If
        Next
    End Sub
End Module

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

See Also

Applies To: VCFileConfiguration Object | VCReferenceConfiguration Object

Show:
© 2015 Microsoft