TemplateData Element (Visual Studio Templates)

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Categorizes the template and defines how it displays in either the New Project or the Add New Item dialog box.

<VSTemplate>
<TemplateData>

<TemplateData>  
    <Name> ... </Name>  
    <Description> ... </Description>  
    <Icon> ... </Icon>  
    <ProjectType> ... </ProjectType>  
    ...  
</TemplateData>  

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

ElementDescription
NameRequired element.

Specifies the name of the template as it appears in either the New Project or the Add New Item dialog box.
DescriptionRequired element.

Specifies the description of the template as it appears in either the New Project or the Add New Item dialog box.
IconRequired element.

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.
ProjectTypeRequired element.

Categorizes the project template so that it appears under the specified group in the New Project dialog box.
ProjectSubTypeOptional element.

Classifies the project template so that it appears under the specified subcategory in the New Project dialog box.
TemplateIDOptional element.

Specifies the template ID.
TemplateGroupIDOptional element.

Specifies the template group ID.
SortOrderOptional element.

Specifies a value that is used to arrange the template, among other templates in the same category, as it appears in either the New Project or Add New Item dialog box.
CreateNewFolderOptional element.

Specifies whether a containing folder is created on instantiation of the project.
DefaultNameOptional element.

Specifies the name that the Visual Studio project system will generate for the project or item when it is created.
ProvideDefaultNameOptional element.

Specifies whether the Visual Studio project system will generate the default name for a project or item when it is created.
PromptForSaveOnCreationOptional element.

Specifies whether the project can be created as a temporary project.
EnableLocationBrowseButtonOptional element.

Specifies whether the Browse button is available in the New Project dialog box, so that users can easily modify the default directory where a new project is saved.
HiddenOptional element.

Specifies whether the template appears in either the New Project or Add New Item dialog box.
NumberOfParentCategoriesToRollUpOptional element.

Specifies the number of parent categories that will display the template in the New Project dialog box.
LocationFieldMRUPrefixOptional element.
LocationFieldOptional element.

Specifies whether or not the Location text box in the New Project dialog box is either enabled, disabled, or hidden for the project template.
RequiredFrameworkVersionOptional element.

Use this element if the template only supports a specific minimum version, and later versions if any, of the .NET Framework.
SupportsMasterPageOptional element.

Specifies whether the template supports a master page for web projects.
SupportsCodeSeparationOptional element.

Specifies whether the template supports code separation, or the code-behind page model, for web projects.
SupportsLanguageDropDownOptional element.

Specifies whether the template is identical for multiple languages, and whether the Language option is available from the New Project dialog box.
TargetPlatformNameOptional element.

Specifies the platform that the project template targets. This element specifies that a project template is used to create Windows 8.x Store apps.

Parent Elements

ElementDescription
VSTemplateRequired element.

Contains all the metadata for the project template, item template, or starter kit.

TemplateData is a required element.

If you do not include an optional element, the default value for that element is used.

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

Show: