1

I am trying to create a visual studio extension menu item and I am having a tough time finding out how to choose which context menu the extension shows up in. Example; I right click on a TFS ticket and I see my added menu item in the context menu and not in the Tools menu. What in a VSPackage project tells Visual Studio where to place my extension?

Matze
  • 5,100
  • 6
  • 46
  • 69
TacoMaster6000
  • 304
  • 3
  • 12
  • There´s already a similar question: http://stackoverflow.com/questions/26902158/append-item-to-add-menu-of-solution-or-project-node-in-solution-explorer/26928566#26928566 – Matze May 11 '16 at 13:44

1 Answers1

2

In your package vsct file the CommandPlacements node handles where to put command items. Generally you are looking at CommandPlacements->CommandPlacement->Parent->id=[Some visual studio constant guid for the menu you want.]

Example, this places my command in the right click context menu of a code editor window, the guid is defined in the constant IDM_VS_CTXT_CODEWIN.

<CommandPlacement guid="guidSquishEditorCmdSet" id="SquishEditorToolbarGroup" priority="0x600">
  <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN" />
</CommandPlacement>
Paul Swetz
  • 2,234
  • 1
  • 11
  • 28