0

I have to make vsix extension in Visual Studio 2019. I can show vsix command context menu in c# code behind code (I am using <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN"/>). This solution works perfect. But I also have to show vsix command context menu in ASPX Context window. Unfortunately, I can't do this one.

Question: How to create vsix extension context menu to "ASPX Context" window?

Cem Kaan
  • 2,086
  • 1
  • 24
  • 55
i-co
  • 1
  • 1

2 Answers2

0

You can use the Command Explorer extension to find out where to place your custom commands.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
0

Getting the ID of the place you want to put your custom command shouldn't be that hard if you just use the Command Explorer Tool.

Adding a command to multiple places can be pretty hard tough, luckily there is a pretty nifty solution and that would be Command Placements.

First of all you need to completely remove all the parenting you added to your Command in the first place. So that he isn't displayed on anything by default.

<Parent guid="guidCommandPackageCmdSet" id="MyMenuGroup"/>

After you've done that you can now add the command placements, to place your Command on as many different places as wished.

The id we refer to is the same as the element we want to display multiple times on different places.

<CommandPlacements>
    <CommandPlacement guid="guidCommandPackageCmdSet" id="CommandId" priority="0x07FF">
        <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN" />
    </CommandPlacement>

    <CommandPlacement guid="guidCommandPackageCmdSet" id="CommandId" priority="0x0500">
        <Parent guid="guidSHLMainMenu" id="ID_OF_ASPX_CONTEXT_MENU" />
    </CommandPlacement>
</CommandPlacements>
IndieGameDev
  • 2,905
  • 3
  • 16
  • 29