This documentation is archived and is not being maintained.

Solution2.AddIns Property 

Gets an AddIns collection, which contains all currently available Add-ins associated with the solution.

Namespace: EnvDTE80
Assembly: EnvDTE80 (in envdte80.dll)

AddIns AddIns { get; }
/** @property */
AddIns get_AddIns ()

function get AddIns () : AddIns

Property Value

An AddIns collection.

Only registered Add-ins appear in the AddIns collection, and they load and unload when the solution loads and unloads.

For information on how to run this add-in code, see How to: Compile and Run the Automation Object Model Code Examples.

using System.Windows.Forms;
public void OnConnection(object application,
 Extensibility.ext_ConnectMode connectMode, object addInInst,
 ref System.Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    // Pass the applicationObject member variable to the code example.
    SolutionAddInsExample((DTE2)_applicationObject);
}
public void SolutionAddInsExample(DTE2 dte)
{
    // This add-in counts the add-ins in a solution.
    // Open a solution in Visual Studio before running this
    // example..
    try{
        Solution2 soln =(Solution2)_applicationObject.Solution;
        // List the number of Add-ins.
        MessageBox.Show("Number of add-ins in" + soln.FullName 
+ " is: " + "\n" + soln.AddIns.Count);
    }
    catch(SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}
Show: