locked
Item Template icons from Visual Studio 2010 RRS feed

  • Question

  • I have been creating several Visual Studio 2010 Item Templates based on existing Visual Studio classes, services etc.  However, once I export the newly created Template, it presents with a generic icon which has nothing to do with the type of Item it is such as a C# class, C# WCF Service etc.

    Since all of my Templates are based on pre-existing Visual Studio Templates, is there any way that I can select the existing Visual Studio 2010 icons to be used for my exported Item Templates as well?

     

    Thanks.

    • Moved by Brittany Behrens Friday, July 9, 2010 11:28 PM (From:Visual Studio Editor)
    Friday, July 9, 2010 8:13 PM

Answers

  • I discovered that this line indicates how to refer to the Icons in the .vstemplate files for each of the various Visual Studio Templates:

    <Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4515" />

    Based on the GUID identifier and the ID that is used for the element determines which icon is displayed for each of the various project and item templates.  Since I can just manually edit my .vstemplate files to match these identifiers, that is sufficient to meet my needs.

    • Marked as answer by vs2015junkie Sunday, March 25, 2012 2:33 AM
    Sunday, March 25, 2012 2:33 AM

All replies

  • Hello,

    Based on my understanding, you want to change Item Template icon to your custom icon, if so, you can open .vstemplate file, and locate the Icon element, change the icon with your custom icon, for example:

    <Icon>MyIcon.ico</Icon>

    For more information, please see:

    How to: Manually Change the Template Icon

    If I misunderstood you, or you have any comments, please feel free to let me know.

     

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, July 12, 2010 6:54 AM
  • No, actually, I would like to know where all of the .ico files that Visual Studio 2010 currently uses are stored since I would like all of my Item Templates to use the exact same icons as Visual Studio 2010.

     

    Thanks.

    Monday, July 12, 2010 10:05 PM
  • Hello,

    All icons of Visual Studio  Item Templates are saved in corresponding packages. For example, the icon of VB Class ItemTemplate is saved in Package {164B10B9-B200-11D0-8C61-00A0C91E29D5} and ID is "4510", and the icon of CSharp Class ItemTemplate is saved in package {FAE04EC1-301F-11d3-BF4B-00C04F79EFBC} and ID is "4515".

    You can refer to ItemTemplatesCache foder under the path %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache to get the icon resource what you want.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, July 13, 2010 3:08 AM
  • Hello,

    I am writing to follow up this issue. Please let me know what I can help. Thanks.

     

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, July 19, 2010 2:27 AM
  • I still can't figure out where the required .ico files are stored.  Where are they?  I don't find them in the .zip files.

     

    Thanks.

    Monday, July 19, 2010 7:31 PM
  • Hi 'vs2010junkie',

    Most of the templates that ship "in the box" in Visual Studio 2010 refer to icons embedded in various VSPackage DLL's as resources. In other words, there aren't a series of .ico files embedded in zip files.

    Note that in the documention for the Icon element, you can specify an icon via a .ico file or via referring to Package Guid + Resource ID. If you really wanted to get to a particular ico file, you'd need to open the corresponding package dll and extract the resource.

    However, you probably shouldn't be re-using icons in Microsoft supplied templates. In addition to potential copyright issues (keep in mind that I Am Not A Lawyer), it could be very confusing for a user to identify the template that they really want if they're seeing duplicate icons/names.

    Regards,
    Aaron

     


    http://blogs.msdn.com/aaronmar
    Monday, July 19, 2010 8:05 PM
  • I discovered that this line indicates how to refer to the Icons in the .vstemplate files for each of the various Visual Studio Templates:

    <Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4515" />

    Based on the GUID identifier and the ID that is used for the element determines which icon is displayed for each of the various project and item templates.  Since I can just manually edit my .vstemplate files to match these identifiers, that is sufficient to meet my needs.

    • Marked as answer by vs2015junkie Sunday, March 25, 2012 2:33 AM
    Sunday, March 25, 2012 2:33 AM
  • The icons are stored in DLLs under folders specific to the project language/type.

    For a C# Windows Service project I found them here

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\VCSPackages\csproj.dll

    You can open them up using Resource Hacker and the icons you want will be under "Icon Groups" and then a subfolder matching the ID defined in the .vstemplate file.

    Eg. 4515 for your example

    Wednesday, February 12, 2014 12:28 AM