Raghu's SharePoint Column : SharePoint - My Lifeline!!

Raghu's SharePoint Column

Template MetaData Files .VSTemplate extensions

To start with VSTemplate, lets first know where are VSTemplate files used.These files are used to create custom ItemTemplate and custom ProjectTemplate.Once these templates are created you can make it appear in the New New Item and the New Project dialog boxes.

1. ItemTemplates: All the templates that appear in the Add New Item Dialog Box are called Item Templates

2. ProjectTemplates: All the templates that appear in the Create/Add New Project Dialog Boxare called Project Templates

Before getting into creation of custom ItemTemplates, lets understand the structure of .VSTemplate which is the core part of Item and Project Templates

The .vstemplate file for project templates consists of three fundamental elements:

1. VSTemplate:  Identifies the template as a project or item template and provides the template version number. The attribute Type for VSTemplate specifies weather its project template or a Item Template

2. TemplateData: Categorizes the project template and defines   display characteristics for the New Project or Add New Item dialog box.It defines the name of the   tempalte,the description of what the template does, its default name and many other attritbute which we will  look into when we create a custom item template in the comnig posts

3. TemplateContent:Specifies the files included in the template.This part of the templates specifes what are the assembly references to be included, what are the default files need to be created when a new item is created usings this template

Apart from the above three fundamental there are other 2 optional sections, which may be needed during creation of custom templates

4. WizardExtension:This custom wizard helps to define additional custom functionality to the custom item templates, like adding the receiver class and the Recevice assembly into the feature dynamically

5. WizardData: This section of the VSTempalte helps us to pass custom xml to the custom wizard extension

Sample VSTemplate structure is shown below

<VSTemplate Version="2.0.0" Type="Item"
<Name>Timer JobName>
<Description>Add a new timer jobDescription>
System.Web, Version=, Culture=neutral,
<Assembly>Microsoft.SharePoint, Version=, Culture=neutral,
 PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSILAssembly>
<Folder Name="FolderName">
<ProjectItem SubType="Code"
 <ProjectItem SubType="Code"
 <ProjectItem SubType="Code"
<Assembly>Wiz.CustomWizard, Version=, Culture=neutral,
PublicKeyToken=d24561bc194c5ab4, Custom=nullAssembly>



No comments yet.

Leave a Reply

Protected by WP Anti Spam