Icon Element (Visual Studio Templates)
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Icon Element (Visual Studio Templates).
Specifies the path and the filename of the image file that serves as the icon, which appears in either the New Project or the Add New Item dialog box, for the template.
<VSTemplate>
<TemplateData>
<Icon>
<Icon>
IconFileName
</Icon>
<Icon Package="{PackageID}" ID="ResourceID" />
The following sections describe attributes, child elements, and parent elements.
Attributes
| Attribute | Description |
|---|---|
Package | Optional attribute, for advanced user scenarios. A GUID that specifies the Visual Studio package ID. |
ID | Optional attribute, for advanced user scenarios. Specifies the Visual Studio resource ID. |
Child Elements
None.
Parent Elements
| Element | Description |
|---|---|
| TemplateData | Required element. Categorizes the template and defines how it displays in either the New Project or the Add New Item dialog box. |
A text value is required unless the Package and ID attributes are used.
The text provides the path and file name of the template icon that will appear in the New Project dialog box.
Icon is a required child element of TemplateData.
The following example shows the metadata for a project template for a Visual C# application.
<VSTemplate Type="Project" Version="3.0.0"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>My template</Name>
<Description>A basic starter kit</Description>
<Icon>TemplateIcon.ico</Icon>
<ProjectType>CSharp</ProjectType>
</TemplateData>
<TemplateContent>
<Project File="MyStarterKit.csproj">
<ProjectItem>Form1.cs<ProjectItem>
<ProjectItem>Form1.Designer.cs</ProjectItem>
<ProjectItem>Program.cs</ProjectItem>
<ProjectItem>Properties\AssemblyInfo.cs</ProjectItem>
<ProjectItem>Properties\Resources.resx</ProjectItem>
<ProjectItem>Properties\Resources.Designer.cs</ProjectItem>
<ProjectItem>Properties\Settings.settings</ProjectItem>
<ProjectItem>Properties\Settings.Designer.cs</ProjectItem>
</Project>
</TemplateContent>
</VSTemplate>
Visual Studio Template Schema Reference
Creating Project and Item Templates