다음을 통해 공유


VCAssemblyReference.Reference 속성

연결된 참조를 가져옵니다.

네임스페이스:  Microsoft.VisualStudio.VCProjectEngine
어셈블리:  Microsoft.VisualStudio.VCProjectEngine(Microsoft.VisualStudio.VCProjectEngine.dll)

구문

‘선언
ReadOnly Property Reference As Object
Object Reference { get; }
property Object^ Reference {
    Object^ get ();
}
abstract Reference : Object with get
function get Reference () : Object

속성 값

형식: Object
VCReference 개체

설명

이 샘플을 컴파일하고 실행하는 방법을 보려면 방법: 프로젝트 모델 확장성에 대한 예제 코드 컴파일을 참조하십시오.

예제

' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This sample displays the path of each reference in a Visual C++
' project. Therefore, make sure you have a Visual C++ project loaded 
' before running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module3
    Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference
        Dim vsref As VSLangProj.Reference
        Dim refproj As Project

        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++ project.
            If Not vcproj Is Nothing Then
                ' Loop each reference in the Visual C++ project.
                For Each ref In vcproj.VCReferences
                    vsref = Nothing
                    vsref = CType(ref.Reference, VSLangProj.Reference)
                    ' If we have the Visual Studio reference.
                    If Not vsref Is Nothing Then
                        MsgBox("The path for reference '" & vsref.Name  _
                          & "' is '" & vsref.Path & "'.")
                    End If
                Next
            End If
        Next
    End Sub
End Module

.NET Framework 보안

참고 항목

참조

VCAssemblyReference 인터페이스

Microsoft.VisualStudio.VCProjectEngine 네임스페이스