Skip to content

Latest commit

 

History

History
83 lines (70 loc) · 3.23 KB

vstemplate-element-visual-studio-templates.md

File metadata and controls

83 lines (70 loc) · 3.23 KB
title description ms.date ms.subservice ms.topic f1_keywords helpviewer_keywords author ms.author manager
VSTemplate Element (Visual Studio Templates)
Learn about the VSTemplate element and how it contains all the metadata about the project template, item template, or starter kit.
11/04/2016
general-ide
reference
VSTemplate element [Visual Studio project templates]
maiak
maiak
mijacobs

VSTemplate element (Visual Studio Templates)

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

Syntax

<VSTemplate Type="TemplateType" Version="x.x.x">
    <TemplateData>    </TemplateData>
    <TemplateContent>    </TemplateContent>
    ...
</VSTemplate>

Attributes and elements

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

Attributes

Attribute Description
Type Identifies the template as a project template or an item template. This attribute can have a value of Project or Item.
Version Specifies a version number for the template. Templates in Visual Studio 2010 and Visual Studio 2012 have a Version attribute value of 3.0.0.

Child elements

Element Description
TemplateData Required element.

Specifies data that categorizes the template, and defines how it displays in the New Project or Add New Item dialog box.
TemplateContent Required element.

Specifies the contents of the template.
WizardExtension Optional element.
WizardData Optional element.

Parent elements

None.

Remarks

The VSTemplate element is the root element of .vstemplate files.

Example

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>

See also