1

I found IDM_VS_CTXT_PROJNODE for single project, and IDM_VS_CTXT_XPROJ_PROJITEM for multiple project but have to select one or more not project file. I want to create a command button like Build Selection.

enter image description here

EDIT:

vsct file:

<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <Extern href="stdidcmd.h" />
  <Extern href="vsshlids.h" />

  <Commands package="guidMyMenuPackage">
    <Menus>
      <Menu guid="guidMyMenuPackageCmdSet" id="MyMenu" type="Menu" priority="0x0700">
        <Strings>
          <ButtonText>MyMenu</ButtonText>
        </Strings>
      </Menu>
    </Menus>

    <Groups>
      <Group guid="guidMyMenuPackageCmdSet" id="RootGroup" priority="0x0600" />
      <Group guid="guidMyMenuPackageCmdSet" id="MyMenuGroup" priority="0x0601" />
    </Groups>

    <Buttons>
      <Button guid="guidMyMenuPackageCmdSet" id="cmdidButton1" priority="0x0101" type="Button">
        <Strings>
          <ButtonText>Button1</ButtonText>
        </Strings>
      </Button>
      <Button guid="guidMyMenuPackageCmdSet" id="cmdidButton2" priority="0x0102" type="Button">
        <Strings>
          <ButtonText>Button2</ButtonText>
        </Strings>
      </Button>
    </Buttons>
  </Commands>

  <CommandPlacements>
    <CommandPlacement guid="guidMyMenuPackageCmdSet" id="RootGroup" priority="0x1011">
      <!--for single project file-->
      <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/>
    </CommandPlacement>
    <CommandPlacement guid="guidMyMenuPackageCmdSet" id="MyMenu" priority="0x0001">
      <Parent guid="guidMyMenuPackageCmdSet" id="RootGroup"/>
    </CommandPlacement>
    <CommandPlacement guid="guidMyMenuPackageCmdSet" id="MyMenuGroup" priority="0x0001">
      <Parent guid="guidMyMenuPackageCmdSet" id="MyMenu"/>
    </CommandPlacement>
    <CommandPlacement guid="guidMyMenuPackageCmdSet" id="cmdidButton1" priority="0x0001">
      <Parent guid="guidMyMenuPackageCmdSet" id="MyMenuGroup"/>
    </CommandPlacement>
    <CommandPlacement guid="guidMyMenuPackageCmdSet" id="cmdidButton2" priority="0x0002">
      <Parent guid="guidMyMenuPackageCmdSet" id="MyMenuGroup"/>
    </CommandPlacement>
  </CommandPlacements>

  <Symbols>
    <GuidSymbol name="guidMyMenuPackage" value="{BDC1A8B0-8D78-43F9-A26F-234517DAF68E}" />

    <GuidSymbol name="guidMyMenuPackageCmdSet" value="{FAACBD48-7657-4CFF-7BD4-39D77F9D1542}">
      <IDSymbol name="RootGroup" value="0x1020"/>
      <IDSymbol name="MyMenuGroup" value="0x1021"/>
      <IDSymbol name="MyMenu" value="0x1022" />

      <IDSymbol name="cmdidButton1" value="0x0101" />
      <IDSymbol name="cmdidButton2" value="0x0102" />
    </GuidSymbol>
  </Symbols>
</CommandTable>

Hourglass
  • 150
  • 1
  • 10
  • Did you want to create a similar command button for multiple project files or projects? More detailed info will help us handle this issue. – Pod Mo Dec 19 '19 at 10:19
  • @GardenCat yes, I had edit my question. – Hourglass Dec 20 '19 at 02:43
  • Did you have any error message about this? In addition, please try [this document](https://stackoverflow.com/questions/51967027/vsix-project-context-menu) which l think might be helpful. – Mr Qian Dec 23 '19 at 11:06

0 Answers0