VSProject.References Property
Visual Studio 2010
Gets the References collection for the project. Read-only.
Assembly: VSLangProj (in VSLangProj.dll)
Property Value
Type: VSLangProj.ReferencesA References collection containing Reference objects, each one representing a reference.
[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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.