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.
Create a project.
Add any files you require, and delete files you do not require.
Modify the files as required.
Add parameter replacements where appropriate. For more information, see How to: Substitute Parameters in a Template.
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.
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.
Related Topics
Title |
Description |
---|---|
Contains links to documents that explain how to create project templates. |
|
Contains links to documents that explain how to create item templates. |
|
Explains how to create templates by using the Export Template Wizard extension. |
|
Explains how to add references to project and item templates. |
|
Explains how to create Web templates. |
|
Explains the folders that Visual Studio examines when it looks for templates. |
|
Provides an overview of the architecture and implementation of project and item templates. |
|
Contains links to documents that describe Starter Kits. |
|
Describes the elements of the Visual Studio template XML schema. |
|
Describes Visual Studio templates and what they contain, and provides an introduction to Starter Kits. |
|
Contains links to documents about parameter substitution, wizards, troubleshooting, and other template customization areas. |