Udostępnij za pośrednictwem


How to: Control Add-ins with the Add-In Manager

The Add-In Manager is a tool for loading and removing add-ins in the integrated development environment (IDE), as well as for specifying their load behavior. The Add-In Manager lists all add-ins that are registered with Visual Studio.

The Add-In Manager Dialog Box

AddInManager screenshot

Using the Add-In Manager, you can:

  • Immediately load or unload an add-in.

  • Specify that an add-in loads at environment startup.

  • Specify that an add-in loads when the environment is started through the command line, such as with a build or make operation.

Loading and Managing Add-Ins

Only registered add-ins appear in the Available Add-Ins list. Add-ins that are created by using the Add-In wizard are automatically registered with Visual Studio. For information about add-in registration and how to manually register add-ins so that they appear in the Available Add-Ins list, see Add-in Registration.

The steps below demonstrate how to load add-ins and specify that they start when the IDE starts.

Note

You cannot use the TAB key to move to the Startup and Command Line columns. You must instead use ALT + S and ALT + C, respectively, to toggle the selections.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. These procedures were developed with the General Development Settings active. To change your settings, choose Import and ExportSettings on the Tools menu. For more information, see Visual Studio Settings.

To load an add-in immediately

  1. On the Tools menu, click Add-In Manager.

  2. Select the add-in from the list.

  3. Check the box next to the add-in in the Available Add-Ins column, and then click OK.

    If the add-in has a user interface, then it appears. Alternatively, the add-in may appear as a toolbar button or a menu command, depending on how the add-in was programmed. If the add-in does not have a user interface (UI), it loads invisibly and begins running.

    Tip

    If you attempt to load an add-in that cannot be located, Visual Studio offers to unregister it so that it no longer appears in the list.

To specify that an add-in should load at environment startup

  1. Select the add-in from the list.

  2. Check the box in the Startup column.

    The next time the environment starts, the add-in will load if it is available.

    Add-in registration information is stored as XML information in a .Addin file or as a key in the Windows registry. For more information, see Add-in Registration.

Invoking Add-ins Through the Visual Studio Devenv Command Line

In addition to using the Add-In Manager to start add-ins, you can also load an add-in at build time by using the Devenv command line. For information, see How to: Run Add-ins on the Command Line and Devenv Command Line Switches.

Preventing Add-ins from Loading at Environment Startup

If you checked the box in the Startup column of the Add-In Manager, your add-in loads when the IDE starts. In some cases you may not want the add-in to start. For example, a problem with your add-in code might that cause Visual Studio to crash, or you may be in the process of writing the add-in and do not want it to auto-start until it is complete.

Fortunately, there is a way to disable add-ins from auto-starting when you start the IDE. To do this, hold down the SHIFT key when Visual Studio starts.

This does not prevent add-ins that have a UI — such as a button on the command bar or a command on a menu — from starting if you click its button or command. It does, however, prevent all add-ins from automatically starting when you start Visual Studio.

Updating the .AddIn XML File After Moving Add-in Projects

When you move an add-in project to another location, you must update its corresponding path in the .AddIn XML file. Otherwise, you get a "Cannot find source file" error.

To avoid this problem, update the path in the following tag in the project's add-in XML file:

<Assembly>C:\MyAddin1.dll</Assembly>

See Also

Tasks

How to: Create an Add-In

Walkthrough: Creating a Wizard

Reference

Visual Studio Commands and Switches

Other Resources

Creating Add-ins and Wizards