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

元气小坏坏 提交于 2019-12-11 17:10:26

问题


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!


回答1:


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:

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.



来源:https://stackoverflow.com/questions/49341650/visual-studio-extensions-calling-options-window-and-id-for-test-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!