Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 3 KB

how-to-create-project-templates.md

File metadata and controls

48 lines (32 loc) · 3 KB
title description ms.date ms.topic f1_keywords helpviewer_keywords author ms.author manager ms.subservice
Create project templates with wizard or XML file
Create project templates in Visual Studio with the Export Template Wizard, or by grouping the project files and using a .vstemplate XML file.
04/04/2024
how-to
VS.ExportTemplateWizard
project templates [Visual Studio], creating
ghogen
ghogen
mijacobs
general-ide

Create project templates

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

  1. Create a project.

    [!NOTE] 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.

  2. 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.

  3. On the Project menu, choose Export Template.

    The Export Template Wizard opens.

  4. On the Choose Template Type page, select Project Template. Select the project you want to export to a template, and then choose Next.

  5. 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.

Related content