Why isn't my vspackage's context menu showing

后端 未结 4 415
天命终不由人
天命终不由人 2021-01-11 12:44

I already have a package that I created, and I\'d like to add a menu to the Code Window context menu.

After a little search I found several articles exp

4条回答
  •  伪装坚强ぢ
    2021-01-11 13:20

    For me, the mentioned constant worked. I started out with the standard template for a VSPackage in Visual Studio 2013, then changed the Parent id to IDM_VS_CTXT_CODEWIN.

    Here's what I have now:

    vsct:

      
    

    the symbols:

    
    
    
      
      
    
    
    
    
      
      
      
      
      
      
    
    

    Adding the menu item in the package class:

                // Create the command for the menu item.
                CommandID menuCommandID = new CommandID(GuidList.guidCopyForReviewVSPackageCmdSet, (int)PkgCmdIDList.cmdidCopyForReview);
                MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID );
                mcs.AddCommand( menuItem );
    

    However, this only shows the menu in the "real" code window, not in the aspx/ascx editor for example.

提交回复
热议问题