本文介绍了如何使用vspackage扩展在visual studio中组合两个具有相同名称的顶级菜单。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我创建名称为"自定义菜单"的顶级菜单从扩展项目,并创建另一个具有相同名称"自定义菜单"的顶级菜单来自另一个扩展项目。我在
视觉工作室中安装了两个VSIX顶级菜单。

I create top level menu with name "Custom Menu" from extension project and also create another top level menu with same name "Custom Menu" from another extension project.After I install both VSIX top level menu shows multiple times in the visual studio.




如何组合两个来自不同扩展名的同名菜单?

How to I combine two menu with same name from different extension?

推荐答案

快速回答是你做不到的。每个菜单/命令都是独立且独特的。这就是为什么它们是通过包guid和ID来识别的。如果你需要一个顶部级别菜单,您必须选择其中一个包作为实现者,然后
其他将需要依赖于实现菜单的包。

The quick answer is you cannot. Each menu/command is separate and unique. This is why they are identified via a package guid and an ID. If you need to have a single top level menu, you'll have to choose one of the packages to be the implementer, and then other will need to be dependent on the package that implements the menu.

含义一个包(没有实现菜单)将需要依赖于另一个包(实现菜单的包)作为先决条件安装。依赖包的.vsixmanifest应该列出另一个包依赖
来实现菜单。

Meaning the one package (that doesn't implement the menu) will need to be dependent on the other package (the one that does implement the menu) to be installed as a prerequisite. The .vsixmanifest of the dependent package should list the other as being dependent on the one that does implement the menu.

此致,


这篇关于如何使用vspackage扩展在visual studio中组合两个具有相同名称的顶级菜单。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:03