Share via


The Spectrum of Visual Studio Automation

Visual Studio offers three different levels of extensibility: macros, add-ins and wizards, and the Visual Studio SDK.

Macros

Macros are the easiest way to extend the Visual Studio integrated development environment (IDE) by using code. Not only do they provide a big productivity boost by letting you record several actions in the IDE and play them back as one command, they also let you learn the Visual Studio Automation models as you record macros. Macros also offer a full-fledged development environment named the Macros IDE, which is based on the IDE. It uses the Visual Basic language and is used for creating, editing, and debugging macros. For more information about macros, see Automating Repetitive Actions by Using Macros.

Add-ins and Wizards

Add-ins are applications that attach to and are used within the Visual Studio IDE. They are COM objects that implement the Extensibility interface and communicate with the IDE through the core automation object model, which is contained in the EnvDTE assemblies. The toolbar model is contained in Microsoft.VisualStudio.CommandBars.

The programming languages in Visual Studio provide additional automation objects through their own assemblies. Some of the project-specific automation assemblies are shown in the following table.

Assembly Name

Description

VSLangProj

Visual Basic and Visual C# project automation model.

VSLangProj2

Visual Basic and Visual C# project automation model.

VSLangProj80

Visual Basic and Visual C# project automation model.

Microsoft.VisualStudio.VCCodeModel

Visual C++ code automation model.

Microsoft.VisualStudio.VCProject

Visual C++ project automation model.

Microsoft.VisualStudio.VCProjectEngine

Visual C++ project automation model.

Microsoft.VisualStudio.VsWizard

Visual C++ wizard automation model.

Because add-ins are compiled as binary code, your intellectual property is protected. You can implement add-ins in any COM-consuming language such as Visual C++, Visual Basic, or Visual C#.

For most developers, macros are sufficient for programming against the Visual Studio Automation model. However, add-ins can be preferable for developers, for example, ISVs, who want to seamlessly add entire new features to the IDE. Add-ins fit such features into the IDE as though they were built-in.

Add-ins also let you do some things that macros cannot. By using add-ins, you can:

  • Host your tool on a menu or toolbar in the IDE.

    This lets you easily access it while you are programming.

  • Create custom property pages for the Options dialog box on the Tools menu.

    For more information, see How to: Create Custom Tools Options Pages.

  • Create tool windows that act just like Visual Studio tool windows.

    For more information, see Creating and Controlling Environment Windows.

  • Dynamically enable and disable commands on menus and the Visual Studio Command bar.

    For more information, see How to: Add and Handle Commands.

  • Add contact and descriptive information to the Visual Studio About dialog box.

Wizards are applications that lead users through a step-by-step process of creating programs or accomplishing programming tasks. For example, Visual Studio offers the Add-In wizard to help users create an add-in project and deployment project. You can create your own wizards by building a project that implements the IDTWizard interface. Wizards are typically invoked through the New Project dialog box or New File dialog box.

Visual Studio SDK

For many users, macros, add-ins, and wizards meet most requirements. However, some users have to go beyond the considerable capabilities of the Visual Studio Automation model. For example, a user who wants to incorporate an entirely new editor or programming language into the IDE might require:

  • A new project type

  • A customized editor

  • Advanced debugging features

The Visual Studio SDK was created to help you integrate your products into the IDE. The Visual Studio SDK is a developer suite and platform. It gives you finer and more extensive control over the IDE by providing access to more interfaces. By using the Visual Studio SDK, you can provide greater functionality for your users. For more information, see Visual Studio Extensibility Developer Center on the MSDN Web site.

See Also

Tasks

Choosing the Appropriate Automation Approach

How to: Create an Add-In

Walkthrough: Creating a Wizard

Concepts

Automation Object Model Chart

Other Resources

Creating Add-ins and Wizards