Visual Studio 扩展 - 测试菜单的调用选项窗口和 ID [英] Visual Studio Extensions - Calling Options Window and Id for Test Menu

查看:77
本文介绍了Visual Studio 扩展 - 测试菜单的调用选项窗口和 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个 Visual Studio 扩展,但我在一些问题上遇到了困难.

  • 创建菜单命令时,它默认进入工具菜单(id="IDM_VS_MENU_TOOLS").我想将其更改为测试"菜单,但在任何地方都找不到它的 ID.

  • 如何向选项"窗口添加呼叫?基本上我想要一个工具 > 我的菜单 > 选项,直接进入我在选项窗口中的项目.

有什么帮助吗?

谢谢!

解决方案

要确定菜单项 ID,您可以使用此处描述的 EnableVSIPLogging 注册表项:

不要忘记做相反的事情.

要显示您自己的选项页面,请创建一个菜单项(使用 vsct 等),然后调用 Package.ShowOptionPage 单击时.

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!

解决方案

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.

这篇关于Visual Studio 扩展 - 测试菜单的调用选项窗口和 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆