We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

AddIn Interface

Represents an add-in listed in the Add-In Manager dialog box and provides information about an add-in to other add-in objects.

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

public interface class AddIn

The AddIn type exposes the following members.

Public propertyCollectionReturns the collection containing the AddIn object that supports this property.
Public propertyConnectedGets or sets a value indicating whether an add-in is loaded and connected.
Public propertyDescriptionGets or sets a string that represents the description for the AddIn object.
Public propertyDTEGets the top-level extensibility object.
Public propertyGuidGets the GUID for the AddIn object.
Public propertyNameGets the name of the AddIn object.
Public propertyObjectSets or gets the object supporting the specified AddIn object.
Public propertyProgIDGets the ProgID based on the add-in's registry entry.
Public propertySatelliteDllPathGets the location of a DLL containing localized resources, if available.

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

An AddIn object provides information about an add-in to other add-ins. Only registered add-ins are represented by an AddIn object.

Sub AddInExample()
   ' For this example to work correctly, there should be an add-in 
   ' available in the Visual Studio environment.
   ' Set object references.
   Dim addincoll As AddIns
   Dim addinobj As AddIn
   ' Register an add-in, check DTE Add-in count before and after the 
   ' Update.
   addincoll = DTE.AddIns
   MsgBox("AddIns collection parent name: " & addincoll.Parent.Name)
   MsgBox("Number of Add-ins: " & addincoll.Count)
   ' NOTE: Use regsvr32 for Visual C++, regasm for Visual Basic 
   ' and Visual C#. Also, the pathname used below is an example only.
   Shell("regasm F:\AddIns\RegExplore\Debug\regexplore.dll")
   MsgBox("Number of Add-ins: " & addincoll.Count)
   addinobj = addincoll.Item(1)

   ' Connect the add-in if it is not already connected
   ' and list its SatelliteDLLPath and Guid.
   If addinobj.Connected = False Then
      addinobj.Connected = True
   End If
   MsgBox("Satellite DLL Path: " & addinobj.SatelliteDllPath)
   MsgBox("DLL GUID: " & addinobj.Guid)

   ' Activates a solution add-in so that it is available, then 
...' deactivates it.
   addinobj = DTE.Solution.AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False)
End Sub