Customizing Visual Studio Extension Icon in Visual Studio 2010

If you have deal with Visual Studio Extension ( VSIX) , you must have seen, after the extension installation default icons are predefined ( As shown in below image ). In this post I am going to describe how you can customize /change the default visual studio extension  icon and can provide your own icon over there. 

image

Before looking into how we can change the icon, first have a quick look how this command customization works. Once you create a new Extension Project, Move to Solution Explorer, Open the .VSCT file as highlighted in below. This .VSCT file is defines  the actual layout and type of the commands.  It is divided in different sections (e.g. command definition, command placement, …), with each defining a specific set of properties.  If you want to customize any of the section where you want to place you extension, you have to change this file.

image

Open the vsct file and move the Bitmaps section. you will find by default image reference is picking up from Resources\Images_32bit.bmp file.

image

This bitmaps section is used for define the images in command window or others windows. In the below image definition,  a list of images has been given as “UsedList”.

image

All the UsedList images, must need be specified in a GuidSymbol area,

image

So, you have noticed for each and every images, there is an IDSymbol and Value. Now based on  Symbol name ( guidImages) and id specified in the command area, images will be piking up from the resource.

image

So, this is how Icons in Visual Studio Extension displayed. Let’s have look how we can customize them. If yow want to customize, first things that you need is 16*16 24bit Bitmap Image . So, first create an images as per your extension, placed the same inside the Resource folder.  This can be list of images, with 16*16 size of 24bit mode or you can use a single image as well. I have used on single image to make it simple.

image

Now, moved to the GuidSymbol area, remove all the previous entry and added you new image name as IDSymbol

image

Once done, the only remaining task is to provide the same name, in the command Button Icon area.

image

The final changes we need to do is to change the mapping in BitMaps area of vsct file.

image

Once done, Run your extension, you can view the customized icon in all the applied command area.

image

Hope this will help you !

Cheers !

AJ

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.