This documentation is archived and is not being maintained.

How to: Force a VSPackage to Load

VSPackages are ordinarily loaded only when their accompanying functionality is required to complete a process. Under some circumstances, however, a VSPackage may have to force another VSPackage to be loaded. For example, a lightweight VSPackage might load a larger VSPackage in a programming context that is not available as a CMDUIContext.

You can use the LoadPackage method to force a VSPackage to load.

To force a VSPackage to load

  • Insert this code into the Initialize method of the VSPackage that forces another VSPackage to load:

    No code example is currently available or this language may not be supported.

    When the VSPackage is initialized, it will force PackageToBeLoaded to load.

Force loading should not be used for VSPackage communication. Use Services instead.

Show: