Share via


VSProject.References 속성

프로젝트의 References 컬렉션을 가져옵니다. 읽기 전용입니다.

네임스페이스:  VSLangProj
어셈블리:  VSLangProj(VSLangProj.dll)

구문

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

속성 값

형식: VSLangProj.References
각각 참조를 나타내는 Reference 개체가 포함된 References 컬렉션입니다.

설명

외부 구성 요소에 대해 코드를 작성하려면 먼저 해당 구성 요소에 대한 참조를 프로젝트에 포함해야 합니다. 3가지 종류의 구성 요소(.NET 어셈블리, COM 자동화 서버와 컨트롤, 같은 솔루션에서 구성 요소를 노출하는 다른 프로젝트)에 대한 참조를 만들 수 있습니다.

예제

[Visual Basic]

' Macro Editor
' Assuming that the first project in the solution is a Visual Basic or C#
' application, this routine lists the references in the project.
Imports VSLangProj
Sub ListReferences()
   ' Retrieve the VSProject object.
   Dim theVSProject As VSProject = _
      CType(DTE.Solution.Projects.Item(1).Object, VSProject)

   ' Retrieve the references collection.
   Dim refs As References = theVSProject.References

   ' Create a string list of the reference names.
   Dim refList As String = ""
   Dim aRef As Reference
   For Each aRef In refs
      refList &= aRef.Identity & ControlChars.CrLf
   Next
   MsgBox(refList)
End Sub

.NET Framework 보안

참고 항목

참조

VSProject 인터페이스

VSLangProj 네임스페이스