Introduction to Visual Studio Templates
Visual Studio project and item templates provide reusable and customizable project and item stubs that accelerate the development process, removing the need to create new projects and items from scratch.
Visual Studio Templates
A number of predefined project and item templates are installed when you install Visual Studio. For example, the Visual Basic, Visual C#, and Visual J# Windows Appliation and Class Library templates available in the New Project dialog box are all examples project templates. Installed item templates are available from the Add New Item dialog box, and include items such as XML files, HTML pages, and Style Sheets.
These templates provide a starting point for users to begin creating new projects or expanding current projects. Project templates provide the basic files needed for a particular project type, include standard assembly references, and set default project properties and compiler options. Item templates can range in complexity from a single empty file with the correct file extension to a multi-file item containing items such as source code files with stub code, designer information files, and embedded resources.
In addition to the installed templates available in the New Project and Add New Item dialog boxes, you can author your own templates or download and use templates created by the community. For more information, seeand .
Contents of a Template
All project and item templates, whether installed with Visual Studio or created by you, function with the same principles and consist of the same contents. All templates contain the following items:
The files to create when the template is used. This includes all source code files, embedded resources, project files, etc.
One .vstemplate file. This file contains the metadata that provides Visual Studio with the information it needs to display the template in the New Project and Add New Item dialog boxes and create a project or item from the template. For more information on .vstemplate files, see.
When these files are compressed into a .zip file and placed in the proper folder, Visual Studio automatically displays them in the My Templates section of the New Project and Add New Item dialog boxes. For more information on template folders, see.
Starter Kits are enhanced templates that can be shared with other members of the community. A Starter Kit includes code samples that compile, documentation, and other helpful resources to enable you to learn new tools and programming techniques while building useful, real world applications. The basic contents and procedures for Starter Kits are identical to those of templates. For more information, see.