locked
Can you install toolbox controls from a project template? Or initialize a VSIP on VS startup? RRS feed

  • Question

  • Currently our product uses a VS Integration Package and installs our custom controls into the VS toolbox when the VSPackage is initialized. This is not ideal, as it is possible our uses could open one of our project templates and require those controls in the toolbox before they'll ever need to run one of the VSIP menu options.

    Is is possible for a project template to add its controls into the toolbox itself? If not, is it possible to have a VSPackage initialized on VS startup rather than when any of its menu items is selected?
    Thursday, February 25, 2010 4:29 PM

Answers

  • Hi Neilhza,

    It's possible to have a VSPackage initialized on VS startup rather than when any of its menu items is selected. You can use the ProvideAutoLoadAttribute class to declare that the package should load when a specific context is active in VS.

    If you want to initialize a VSPackage when toolbox, you can use following code:

    [ProvideAutoLoad(Microsoft.VisualStudio.Shell.Interop.UIContextGuids80.ToolboxInitialized)] 
    


    For more information, please see:

    http://blogs.msdn.com/allend/archive/2006/05/04/590055.aspx

    And I would suggest you checking this thread,maybe it's also useful:

    VsPackage: ProvideAutoLoad only works in VS experimental hive

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, March 4, 2010 2:42 AM
    Monday, March 1, 2010 8:54 AM

All replies

  • Hi Neilhza,

    It's possible to have a VSPackage initialized on VS startup rather than when any of its menu items is selected. You can use the ProvideAutoLoadAttribute class to declare that the package should load when a specific context is active in VS.

    If you want to initialize a VSPackage when toolbox, you can use following code:

    [ProvideAutoLoad(Microsoft.VisualStudio.Shell.Interop.UIContextGuids80.ToolboxInitialized)] 
    


    For more information, please see:

    http://blogs.msdn.com/allend/archive/2006/05/04/590055.aspx

    And I would suggest you checking this thread,maybe it's also useful:

    VsPackage: ProvideAutoLoad only works in VS experimental hive

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, March 4, 2010 2:42 AM
    Monday, March 1, 2010 8:54 AM
  • Thank you so much for the solution Nancy, my apologies I forgot to mark this as the answer :)
    Thursday, March 4, 2010 9:44 AM