Chapter 52VSPackages Code Downloads for this Chapter

The code downloads for this chapter are found at on the Download Code tab. The code and any related support files are located in their own folder for this chapter.

VSPackage Extensions (or just VSPackages) are components that run within Visual Studio and extend its functionality via the Visual Studio automation model. They are a functional replacement for Visual Studio add-ins, which were deprecated for Visual Studio 2015 and beyond.

This chapter takes you through the process of creating a VSPackage that integrates with the Visual Studio IDE to display a tool window (that enables you to store some notes), perform actions in Visual Studio (copy selected text from the code editor), and handle Visual Studio events.

Developing a VSPackage Extension

When you create a VSPackage Extension project, a wizard appears and helps you create the appropriate structure and base functionality in your component based on your answers to its questions. From there you are on your own to implement the functionality from this base framework. You start from the base that it gives you and gradually add functionality to make it a useful tool.

The VSPackage Wizard

Start by creating a new project, using the Visual Studio Package template ...

Get Professional Visual Studio 2015 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.