locked
VS 2008 AddIn - how to add items to the context menu for an unloaded project RRS feed

  • Question

  • Hi,

    I've created a VS2008 addin project, and wish to add a context menu item for the following scenario: Right Clicking on an unloaded project within the Solution Explorer of visual studio.

    Currently this context menu shows "Reload project, Edit {project name}.csproj, Edit, Remove".

    I would like to add my own menu item here.

    Can anyone help with how I can reference this menu?  I can add to the "Tools" menu with the default AddIn code:

    Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar = ((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.CommandBars)["Tools"];

    I have enumerated the CommandBars collection, and have found a wealth of context menu's, however none that match the 'unloaded' project context menu items.

    I have also used the Macro IDE, to expose VS context menu's within the VS IDE, yet I still cannot find this context menu.

    I can see by viewing forum posts here that it is possible to add items to this menu, however I am a little stuck as to how. 

    Can anyone point me in the direction of a good walkthrough, or demo, or even a good reading resource for the topic?

    Thank you for any help,

    Best,

    Bilf

    Tuesday, April 21, 2009 11:53 AM

Answers

  • See:

    HOWTO: Guessing the name of a command bar to add a custom menu entry in Visual Studio .NET add-ins.
    http://www.mztools.com/articles/2004/MZ2004002.aspx
    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about VS extensibility: http://msmvps.com/blogs/carlosq/
    • Marked as answer by bilf Friday, April 24, 2009 2:31 PM
    Thursday, April 23, 2009 11:06 AM

All replies