Click to Rate and Give Feedback
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio SDK
IVsPackage Interface

Updated: November 2007

Initializes a VSPackage in the environment and makes its services available to the environment.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Visual Basic (Declaration)
<GuidAttribute("D4F3F4B1-E900-4E51-ADB3-D532348F83CB")> _
<InterfaceTypeAttribute()> _
Public Interface IVsPackage
Visual Basic (Usage)
Dim instance As IVsPackage
C#
[GuidAttribute("D4F3F4B1-E900-4E51-ADB3-D532348F83CB")]
[InterfaceTypeAttribute()]
public interface IVsPackage
Visual C++
[GuidAttribute(L"D4F3F4B1-E900-4E51-ADB3-D532348F83CB")]
[InterfaceTypeAttribute()]
public interface class IVsPackage
JScript
public interface IVsPackage

This is the mandatory interface to be implemented in any VSPackage and is used by the environment to call on the VSPackage for services they might provide. Most environment extensions start out by loading a VSPackage, which is sited to the environment. The calling VSPackage is handed a pointer to a service provider. See illustrations of the implementation and/or calling of this interface in the Samples provided by Visual Studio Integration Program (VSIP). The standard IVsPackage implementation of the above samples is in VsPkg.cpp found within the sample files for each sample. VsPkg.rgs, also found in the sample files for each sample, registers the respective VsPackages and their (possible) menus, commands, and editor or project factories.

Notes to Implementers:

Implement IVsPackage whenever you initialize a VSPackage.

If a package needs to block shutdown of the IDE it should implement IVsPackage2.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker