VCProject.RemoveReference, méthode

Supprime de la collection de références ou du projet la référence spécifiée.

Espace de noms :  Microsoft.VisualStudio.VCProjectEngine
Assembly :  Microsoft.VisualStudio.VCProjectEngine (dans Microsoft.VisualStudio.VCProjectEngine.dll)

Syntaxe

'Déclaration
Sub RemoveReference ( _
    pDispRef As Object _
)
void RemoveReference(
    Object pDispRef
)
void RemoveReference(
    [InAttribute] Object^ pDispRef
)
abstract RemoveReference : 
        pDispRef:Object -> unit 
function RemoveReference(
    pDispRef : Object
)

Paramètres

  • pDispRef
    Type : System.Object
    Référence à supprimer du projet ou de la collection de références.

Exemples

Consultez Comment : compiler l'exemple de code pour l'extensibilité du modèle de code Visual C++ pour plus d'informations sur comment compiler et exécuter cet exemple.

RemoveReference ajoute une référence d'assembly. NET à votre projet selon le chemin d'accès à l'assembly, si possible, puis supprime l'.

Imports EnvDTE
Imports System.Diagnostics
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim ref As VCReference
        prj = DTE.Solution.Projects.Item(1).Object
        If prj.CanAddAssemblyReference("d:\winnt\microsoft.net _
          \framework\v1.1.4322\envdte.dll") Then
            ref = prj.AddAssemblyReference("d:\winnt\microsoft.net _
              \framework\v1.1.4322\envdte.dll")
        End If
        MsgBox("Reference was added. Now removing the reference.")
        prj.RemoveReference(ref)
    End Sub
End Module

Sécurité .NET Framework

Voir aussi

Référence

VCProject Interface

Microsoft.VisualStudio.VCProjectEngine, espace de noms