Creating Project and Item Templates

You can create custom project templates and project item templates and have these templates appear in the New Project and Add New Item dialog boxes.

Preparing Projects and Files

Follow this general process to create a template.

  1. Create a project.

  2. Add any files you require, and delete files you do not require.

  3. Modify the files as required.

  4. Add parameter replacements where appropriate. For more information, see How to: Substitute Parameters in a Template.

  5. If you have undefined parameters that require user input, or want Visual Studio to perform certain actions when a project or file is created, make a wizard. For more information, see How to: Use Wizards with Project Templates.

  6. Create the template.

    When a user loads your template, he starts with copies of the files in the template, and with substituted parameters resolved.

Template Creation Strategies

There are four ways to create a template in Visual Studio.

Export Template Wizard

The Export Template wizard is a fast way to convert a project or file to a template. Its build output is a compressed file. For more information, see Creating Project Templates and Creating Item Templates.

Export Template Wizard Extension

The Export Template wizard extension resembles the standard Export Template wizard, except that its build output is a VSIX file, which enables more deployment options. You can download the wizard extension from Extension Manager. For more information, see How to: Use the Template Wizard Extension.

SDK Templates

The Visual Studio SDK includes a Project Template template and an Item Template template. These templates include some default parameter substitutions, and build out to compressed files. We recommend the SDK templates for extensions that have multiple templates that require version control, and for scenarios that are not supported by the Export Template wizard.

Manual Creation

You can manually create a template by developing the required files and then packaging them into a compressed file. For more information, see How to: Manually Create Project Templates and How to: Manually Create Item Templates.

Title

Description

Creating Project Templates

Contains links to documents that explain how to create project templates.

Creating Item Templates

Contains links to documents that explain how to create item templates.

How to: Use the Template Wizard Extension

Explains how to create templates by using the Export Template Wizard extension.

How to: Add References to Templates

Explains how to add references to project and item templates.

How to: Manually Create Web Templates

Explains how to create Web templates.

How to: Locate and Organize Project and Item Templates

Explains the folders that Visual Studio examines when it looks for templates.

Visual Studio Templates

Provides an overview of the architecture and implementation of project and item templates.

Starter Kits

Contains links to documents that describe Starter Kits.

Visual Studio Template Schema Reference

Describes the elements of the Visual Studio template XML schema.

Introduction to Visual Studio Templates

Describes Visual Studio templates and what they contain, and provides an introduction to Starter Kits.

Customizing Project and Item Templates

Contains links to documents about parameter substitution, wizards, troubleshooting, and other template customization areas.