Condividi tramite


Metodo VCProject.RemoveReference

Rimuove il riferimento specificato dal progetto o dalla raccolta di riferimenti.

Spazio dei nomi:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Sintassi

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

Parametri

  • pDispRef
    Tipo: System.Object
    Il riferimento da rimuovere dal progetto o dalla raccolta di riferimenti.

Esempi

vedere Procedura: compilare codice di esempio per l'Extensibility del modello di codice di Visual C++ per informazioni su come compilare ed eseguire l'esempio.

RemoveReference aggiunge un riferimento di assembly .NET. al progetto basato sul percorso dell'assembly, se possibile quindi la rimozione.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

VCProject Interfaccia

Spazio dei nomi Microsoft.VisualStudio.VCProjectEngine