I published a Visual Studio 2010 extension called Duplicate Selection , which is mainly called using a hotkey. However, it also has a menu item in the "Edit" menu. All this works fine, but I want to change the icon for the menu item. The icon for the menu item must be defined in the .vsct file:
<Commands package="guidDupSelectionPkg"> <Groups> <Group guid="guidDupSelectionCmdSet" id="MyMenuGroup" priority="0x0600"> <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_EDIT"/> </Group> </Groups> <Buttons> <Button guid="guidDupSelectionCmdSet" id="cmdidDupSelection" priority="0x0100" type="Button"> <Parent guid="guidDupSelectionCmdSet" id="MyMenuGroup" /> <Icon guid="guidCmdIcon" id="bmpCmdIcon" /> <CommandFlag>DynamicVisibility</CommandFlag> <CommandFlag>DontCache</CommandFlag> <CommandFlag>DefaultInvisible</CommandFlag> <Strings> <CommandName>cmdidDupSelection</CommandName> <ButtonText>Duplicate Selection</ButtonText> </Strings> </Button> </Buttons> <Bitmaps> <Bitmap guid="guidCmdIcon" href="Resources\cmdicon.bmp" usedList="bmpCmdIcon" /> </Bitmaps> </Commands> <KeyBindings> <KeyBinding guid="guidDupSelectionCmdSet" id="cmdidDupSelection" key1="D" mod1="Alt" editor="guidVSStd97"/> </KeyBindings> <Symbols> <GuidSymbol name="guidDupSelectionPkg" value="{e5f7e157-f686-46b7-a588-85b08cdaa5f0}" /> <GuidSymbol name="guidDupSelectionCmdSet" value="{85dcd5f2-19a5-4ee2-a99b-4fac4dc5c4ca}"> <IDSymbol name="MyMenuGroup" value="0x1020" /> <IDSymbol name="cmdidDupSelection" value="0x0100" /> </GuidSymbol> <GuidSymbol name="guidCmdIcon" value="{e4cc0e42-a09d-4602-a965-d2b3f7e1f496}"> <IDSymbol name="bmpCmdIcon" value="1" /> </GuidSymbol> </Symbols>
You can see that I commented on old definitions that I no longer want to use, and added my own. At the top, I have <Icon guid="guidCmdIcon" id="bmpCmdIcon" /> , which should reference my new bitmap. When I run the project under the debugger, the experimental VS instance still uses the old icon! Is this a bug in VS? This icon is not yet defined in my vsct file. How could he use her? Did I do something wrong here?
Any suggestions or specs will be considered. I tried several different things, but I'm officially fixated on this.
source share