Export (0) Print
Expand All

ProvideToolWindowAttribute Class

Notifies Visual Studio that a VSPackage owns a tool window.

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

[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class ProvideToolWindowAttribute : RegistrationAttribute

When to Call

Implement the ProvideToolWindowAttribute class when a VSPackage implements one or more tool windows.

Basic Usage

This attribute declares that a specific VSPackage owns a tool window. It also helps determine the positioning and persistence of the tool window when it is created. To use ProvideToolWindowAttribute, place it on a package class derived from Package or implementing IVsPackage.

This attribute is only used to provide data for external registration tools. It does not have any effect on the runtime behavior of the VSPackage.

Registry Entries

  • The ProvideToolWindowAttribute class creates the following registry entries:

  • <VSROOT>\ToolWindows\{ToolWindowGuid}

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\@={ToolWindowTypeGuid}

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\Name=ToolWindowName

  • The following registry entries are optional:

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\Float=FloatPosition

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\Style=ToolWindowStyle

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\Window=DockWith

  • <VSROOT>\ToolWindows\{ToolWindowGuid}\Orientation=ToolWindowOrientation


You can find an implementation of the ProvideToolWindowAttribute class in the Managed Single-Instance Tool Window sample. The standard location for this and all other attributes used for automatic registration is adjacent to the implementation of the Package class in VsPkg.cs, VsPkg.vb, or VsPkg.cpp, depending on the language used in the sample.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2015 Microsoft