Search code examples
visual-studio-extensions

How to specify in VS SDK to load my AsyncPackage immediately after Visual Studio is open?


It can be in background, but the trigger must be opening Visual Studio or installing the extension into a running instance.

I am new to VS SDK and working off this example - https://github.com/microsoft/VSSDK-Extensibility-Samples/tree/master/SolutionLoadEvents


Solution

  • Add the following attribute to the VSPackage class in addition to your UICONTEXT.SolutionOpening:

    [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)]
    

    It will load your extension after opening Visual Studio, but not immediately as all extensions are loaded in background.

    Installing the extension into a running VS instance is not possible.