title | description | ms.date | ms.topic | helpviewer_keywords | author | ms.author | manager | ms.subservice | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Update existing project or item templates |
Use the Visual Studio Export Template Wizard or a manual process to update existing project or item templates. |
04/14/2025 |
how-to |
|
ghogen |
ghogen |
mijacobs |
general-ide |
After you create a Visual Studio project or item template by compressing the template files into a .zip file, you might want to modify the template. This article explains how to modify an existing template by using the Export Template Wizard or by manually changing the files in the template.
You can use the Visual Studio Export Template Wizard to update an existing template.
-
Choose File > New > Project from the menu bar.
-
Select the project template you want. If you want to update an existing project template, select that template.
-
Follow the steps to create the new project.
-
To change the project template, modify the project in Visual Studio. For example, change the output type or add a new file to the project.
-
To change an item template, select Project > Add New Item, and add the item template from the Add New Item dialog box. Make any changes you want in the item.
-
On the Project menu, choose Export Template. The Export Template Wizard opens.
-
On the Template Type page, select either Project Template or Item Template, depending on which type you want to export.
-
Follow the prompts in the wizard to export the template as a .zip file.
-
If you select the option to Automatically import the template into Visual Studio, the wizard places the .zip file in the \ProjectTemplates or \ItemTemplates folder at %USERPROFILE%\Documents\Visual Studio <version>\Templates to make it available for future projects. If you don't select this option, paste the .zip file in the user template location manually.
-
Delete the old template .zip file if necessary.
You can update an existing template without using the Export Template Wizard by manually modifying the files in the template .zip file.
-
Locate the .zip file that contains the template. User templates are located in the \ProjectTemplates or \ItemTemplates folder at %USERPROFILE%\Documents\Visual Studio <version>\Templates.
-
Extract the .zip file.
-
Modify the current template files, or delete or add new files to a project template.
-
Open, modify, and save the .vstemplate XML file to handle updated behavior or new files.
For more information about the .vstemplate schema, see the Visual Studio template schema reference. For more information about what you can parameterize in the source files, see Template parameters.
-
In Windows Explorer, select the files for your template, including the .vstemplate file. Right-click the selection and select Compress to > ZIP File.
-
Copy the resulting .zip file and paste it in the same directory as the old .zip file.
-
Delete the extracted template files, and delete the old template .zip file if necessary.