Proprietà VSProject.References
Aggiornamento: novembre 2007
Ottiene l'insieme dell'oggetto References per il progetto. Di sola lettura.
Spazio dei nomi: VSLangProj
Assembly: VSLangProj (in VSLangProj.dll)
Sintassi
ReadOnly Property References As References
Dim instance As VSProject
Dim value As References
value = instance.References
References References { get; }
property References^ References {
References^ get ();
}
function get References () : References
Valore proprietà
Tipo: VSLangProj.References
Insieme References che contiene oggetti Reference, ciascuno rappresentante un riferimento.
Note
Prima di creare codice in base a un componente esterno, è necessario che il progetto contenga un riferimento a tale componente. È possibile fare riferimento a tre tipi di componenti: assembly .NET, server e controlli di automazione COM nonché altri progetti all'interno della stessa soluzione che espongono componenti.
Esempi
' 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
Autorizzazioni
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.