How to: Create project templates
Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
This article shows you how to create a template by using the Export Template Wizard, which packages your template in a .zip file.
Use the Export Template Wizard
Create a project.
Use only valid identifier characters when you name a project that's the source for a template. Otherwise, compilation errors can occur in projects that're created from the template. For more information about valid identifier characters, see Declared element names (Visual Basic) or Identifiers (C++). Alternatively, you can use Template parameters to use "safe" names for classes and namespaces.
Edit the project until it's ready to be exported as a template. For example, you might want to edit code files to indicate where parameter replacement should take place. For more information, see How to: Substitute parameters in a template.
On the Project menu, choose Export Template.
The Export Template Wizard opens.
On the Choose Template Type page, select Project Template. Select the project you want to export to a template, and then choose Next.
On the Select Template Options page, enter a name and optional description, icon image, and preview image for your template. These items will appear in the dialog box where you create a new project. Select Finish.
The project is exported into a .zip file and placed in the specified output location, and, if selected, imported into Visual Studio.
To find your template in the dialog box where you create a new project, search for it by name or scroll through the list. (Filtering based on language or project type isn't currently possible for user templates.)
Other ways to create project templates
You can create project templates manually by gathering the files that constitute the project into a folder and creating a .vstemplate XML file with the appropriate metadata. For more information, see How to: Manually create web templates.
If you have the Visual Studio SDK installed, you can wrap the finished template in a VSIX file for deployment by using the VSIX Project template. For more information, see Get started with the VSIX project template.