Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Package.Initialize Method

Called when the VSPackage is loaded by Visual Studio.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

protected virtual void Initialize()

Override Initialize when you need to carry out additional steps (such as Editor Factory registration) when the VSPackage is loaded by Visual Studio.

Place any initialization steps that require access to the global service provider (such as Editor Factory registration) in the Initialize method.

In contrast, steps such as adding services, adding option keys, and toolbox event handlers should be placed in the Package constructor method.

Show:
© 2015 Microsoft