Share via


AddIn.Remove Method

Removes the add-in from the collection of add-ins and makes it unavailable.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub Remove
void Remove()
void Remove()
abstract Remove : unit -> unit
function Remove()

Remarks

This removes an add-in from the list of add-ins in the Add-In Manager dialog box. The Remove method applies only to add-ins that load with the solution. The Remove method fails on items in the collection associated with the DTE object.

Examples

Sub RemoveExample()
   ' Set object references.
   Dim addincoll As AddIns
   Dim addinobj As AddIn
   Dim abc As AddIn
        
   ' Register an add-in.
   addincoll = AddIns
   Shell("regsvr32 F:\AddIns\RegExplore\Debug\regexplore.dll")
   addincoll.Update()
   addinobj = addincoll.Item(1)

   ' Connect the add-in if it is not already connected.
   If addinobj.Connected = False Then
      addinobj.Connected = True
   End If

   ' Add an add-in to the Add-In Manager dialog box, then remove it.
   abc = ProjectSolution().AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False)
   ProjectSolution().AddIns.Item(1).Remove()
End Sub

.NET Framework Security

See Also

Reference

AddIn Interface

EnvDTE Namespace