locked
Unable to see the added custom command in isolated shell. RRS feed

  • Question

  • Hi all,

    I have created a test VS package project and then add a test custom command using custom command template which shows random message once that command gets invoked. I tested it in integrated shell(VS expermental instance), but i am not able to see the added custom command in isolated shell.

    Is there any solution for this, Do i need to modify .vsct file for this case ?


    H.S.Navarkar

    Tuesday, January 3, 2017 9:11 AM

Answers

  • Hi Hemant Navarkar,

    If you want to create a isolated shell custom command, please refer the following steps.

    1. On the Basic VSPackage Information page of the wizard, set Company name to Fabrikam and VSPackage name to FabrikamMenuCommands. Choose the Next button.

    2. On the next page, select Menu Command and then choose Next.

    3. On the next page, set Command name to Fabrikam Command and Command ID to cmdidFabrikamCommand, and then choose Next.

    4. On the Select Test Project Options page, clear the test options, and then choose the Finish button.

    5. In the ShellExtensionsVSIX project, open the source.extension.vsixmanifest file.

      The Assets section should contain an entry for the VSShellStub.AboutBoxPackage project.

    6. Choose the New button.

    7. In the Add New Asset window, in the Type list, select Microsoft.VisualStudio.VsPackage.

    8. In the Source list, make sure that A project in the current solution is selected. In the Project list box, select MenuCommandsPackage.

    9. Save and close the file.

    10. Rebuild the solution and start debugging the isolated shell.

    11. On the menu bar, choose Tools menu, then Fabrikam Command.

      A message box should appear.

    12. Stop debugging the application.

    13. Add a Visual Studio Package project named MenuCommandsPackage.

    For more information, please refer to:

    https://msdn.microsoft.com/en-us/library/ee524005.aspx

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 4, 2017 7:20 AM

All replies

  • Yes, you have to edit .vsct file, among others.

    If your command were a button in Window menu (check <Parent> tag), for a "Hello World" command you could add a button tag in <Buttons> section like this:

    <Buttons>
      <Button guid="guidHelloWorldPkgCmdSet" id="cmdidHelloWorld" priority="0x0101" type="Button">
        <Parent guid="guidSHLMainMenu" id="IDG_VS_WINDOW_NEW"/>
        <Icon guid="guidImages" id="bmpHelloWorld" />
        <Strings>
          <ButtonText>Hello world</ButtonText>
        </Strings>
      </Button>
    </Buttons>


    A GUID symbol:

    <GuidSymbol name="guidHelloWorldPkgCmdSet" value="{82c7cb5e-0244-420c-ae0f-30335594f47f}">
      <IDSymbol name="cmdidHelloWorld" value="0x0100" />
    </GuidSymbol>


    Maybe an image:

    <GuidSymbol name="guidImages" value="{zc7048a3-e5b2-45b7-9798-e7def59eca00}" >
      <IDSymbol name="bmpHelloWorld" value="1" />
    </GuidSymbol>

    This code is just an example, edit it to fit your project needs.

    Regards.




    • Edited by pintope Tuesday, January 3, 2017 4:54 PM
    Tuesday, January 3, 2017 11:28 AM
  • I forgot to mention that in order to load the icon you should also need to specify an image file:

    <Bitmaps>
       <Bitmap guid="guidImages" href="Resources\images.png" usedList="bmpHelloWorld"/>
    </Bitmaps>

    This is what you should need to edit in .vsct file.


    • Edited by pintope Tuesday, January 3, 2017 4:54 PM
    Tuesday, January 3, 2017 4:53 PM
  • Hi Hemant Navarkar,

    If you want to create a isolated shell custom command, please refer the following steps.

    1. On the Basic VSPackage Information page of the wizard, set Company name to Fabrikam and VSPackage name to FabrikamMenuCommands. Choose the Next button.

    2. On the next page, select Menu Command and then choose Next.

    3. On the next page, set Command name to Fabrikam Command and Command ID to cmdidFabrikamCommand, and then choose Next.

    4. On the Select Test Project Options page, clear the test options, and then choose the Finish button.

    5. In the ShellExtensionsVSIX project, open the source.extension.vsixmanifest file.

      The Assets section should contain an entry for the VSShellStub.AboutBoxPackage project.

    6. Choose the New button.

    7. In the Add New Asset window, in the Type list, select Microsoft.VisualStudio.VsPackage.

    8. In the Source list, make sure that A project in the current solution is selected. In the Project list box, select MenuCommandsPackage.

    9. Save and close the file.

    10. Rebuild the solution and start debugging the isolated shell.

    11. On the menu bar, choose Tools menu, then Fabrikam Command.

      A message box should appear.

    12. Stop debugging the application.

    13. Add a Visual Studio Package project named MenuCommandsPackage.

    For more information, please refer to:

    https://msdn.microsoft.com/en-us/library/ee524005.aspx

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 4, 2017 7:20 AM
  • Thanks Cole Wu It seems to be working.


    H.S.Navarkar

    Wednesday, January 4, 2017 11:58 AM