共用方式為


Choosing the Appropriate Automation Approach

Visual Studio add-ins are deprecated in Visual Studio 2013. You should upgrade your add-ins to VSPackage extensions. For more information about upgrading, see FAQ: Converting Add-ins to VSPackage Extensions.

Visual Studio provides several options for creating automation applications. The exact method to choose, however, depends largely on the impending task. To help guide you to the best method, consider the following factors.

Do you want to distribute the code or a compiled application?

Distribute a compiled application — Use either an add-in or a wizard, or an application that uses the automation interfaces. Add-ins, wizards, and other applications that use the automation interfaces protect your intellectual property through compilation. However, to distribute them, you must use a deployment project or some other form of setup. For more information, see How to: Create an Add-In or Walkthrough: Creating a Wizard.

What programming language do you want to use to develop your automation application?

  • Visual Basic — You can create add-ins, or wizards. For more information, see Creating Add-ins and Wizards.

  • Other languages — You can create add-ins and wizards by using the IDTExtensibility2 interface and the IDTWizard interface. You must be able to implement a CoCreate-able COM object in the programming language.

Does the task require user input?

  • No user input is needed — An add-in is suitable. For more information, see Creating Add-ins and Wizards.

  • Simple input — A add-in, or wizard is suitable.

  • Complex input — If the input has many steps or requires verification, a wizard may be most appropriate.

How do you think your user will start your application?

  1. Menus or command bars — Use an add-in.

  2. New Project or New Item menu item — A wizard is typical for adding a new project or file to an application.

  3. Autostarting with the IDE — Use an add-in. What do you need to develop?

  • An automated task — Add-ins, and wizards can all be used to automate tasks. For more information, see Creating Add-ins and Wizards.

  • Custom property pages for the Tools, Options dialog box — Add-ins and wizards support this functionality. For more information, see How to: Create Custom Options Pages. You can also create these using the Visual Studio SDK. For more information, see Extend Visual Studio.

  • Custom tool or document window — Add-ins and wizards support this functionality. For more information, see How to: Create and Control Tool Windows. You can also create these using the Visual Studio SDK. (Note that Document.Open() is an internal-only member.)

  • A new project type — Use the Visual Studio SDK.

  • Support for a new programming language in Visual Studio or a new editor— Use the Visual Studio SDK.

See Also

Tasks

How to: Create an Add-In

Walkthrough: Creating a Wizard

Concepts

Automation Object Model Chart

Spectrum of Visual Studio Automation

Other Resources

Extending the Visual Studio Environment

Creating Add-ins and Wizards