Commands and menus that use Interop assemblies

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

A VSPackage that implements menu and toolbar commands by using Interop assemblies must:

  • Inform the Visual Studio integrated development environment (IDE) about the commands it supports and whether they are currently enabled.

  • Adhere to the rules (contract) for handling commands.

  • Explicitly implement command handling by using either the IOleCommandTarget or IVsUIHierarchy interface.

    The following section describes how to do these tasks.

In this section

Describes how a VSPackage notifies the IDE about which commands it supports and whether they are currently enabled.

Provides a definition of the basic command contract used by all VSPackages implementing commands using Interop assemblies.

Provides an overview of how a VSPackage implements a command.

Describes the registry entries required to notify the IDE that a VSPackage provides a command handler.

Describes criteria that are used by the IDE to determine which VSPackage commands are available and what object handles them.

Provides details about how to create a UI that uses Visual Studio command support.

An overview of the process used to relate an object with the correct command request.