Search code examples
visual-studio-extensionsvsx

Visual Studio Extensions - Calling Options Window and Id for Test Menu


I'm trying to create a Visual Studio extension but I'm struggling with a few points.

  • When creating a Menu Command, it goes by default to the Tools menu ( id="IDM_VS_MENU_TOOLS"). I want to change it to the Test menu, but I can't find the id for it anywhere.

  • How can I add a call to the Options window? Basically I want to have a Tools > My Menus > Options that goes straight to my items in the Options windows.

Any help?

Thanks!


Solution

  • To determine a menu item id, you can use the EnableVSIPLogging registry key described here: Using EnableVSIPLogging to identify menus and commands with VS 2005 + SP1.

    Note if you use Visual Studio 2017, you will have to do it in VS' private registry, using the procedure described here: Access Visual Studio 2017's private registry hive, and the EnableVSIPLogging value would be located in a key that will look like this (5e87da33 will be something different, specific to your setup):

    <your private key name>\Software\Microsoft\VisualStudio\15.0_5e87da33\General
    

    Once this is done you can CTRL+SHIFT click on "Test" and it will show you this:

    enter image description here

    Don't forget to do the reverse.

    To show your own option page, create a menu item (using vsct, etc.), and call Package.ShowOptionPage when clicked.