Skip to content

Commit f4990c4

Browse files
committed
update template
1 parent 36b234f commit f4990c4

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed
Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Update existing project item templates
3-
description: Use the Export Template Wizard and other manual processes in Visual Studio to update project item templates that you already created.
4-
ms.date: 01/02/2018
2+
title: Update existing project or item templates
3+
description: Use the Visual Studio Export Template Wizard or a manual process to update existing project or item templates.
4+
ms.date: 04/14/2025
55
ms.topic: how-to
66
helpviewer_keywords:
77
- item templates, updating
@@ -13,57 +13,41 @@ ms.author: ghogen
1313
manager: mijacobs
1414
ms.subservice: general-ide
1515
---
16-
# Update existing templates
16+
# Update existing project or item templates
1717

18-
After you create a template and compress the files into a *.zip* file, you may want to modify the template. You can do this by manually changing the files in the template or by exporting a new template from a project that's based on the template.
18+
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 exporting a new template from a project that's based on the template, or by manually changing the files in the template.
1919

2020
## Use the Export Template Wizard
2121

22-
Visual Studio provides an **Export Template Wizard** that can be used to update an existing template:
22+
You can use the Visual Studio **Export Template Wizard** to update an existing template.
2323

2424
1. Choose **File** > **New** > **Project** from the menu bar.
25-
26-
1. Select the template that you want to update and continue through the steps to create the new project.
27-
25+
1. Select an existing project template that you want to update, and create the new project.
2826
1. Modify the project in Visual Studio. For example, change the output type or add a new file to the project.
29-
30-
1. On the **Project** menu, choose **Export Template**.
31-
32-
The **Export Template Wizard** opens.
33-
34-
1. Follow the prompts in the wizard to export the template as a *.zip* file.
35-
36-
1. (Optional) Place the *.zip* file in the following directory: *%USERPROFILE%\Documents\Visual Studio \<version\>\Templates\ProjectTemplates* to make it available for selection. You'll need to perform this step if you did not select the option **Automatically import the template into Visual Studio** in the **Export Template Wizard**.
37-
38-
1. Delete the old template *.zip* file.
27+
1. 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.
28+
1. On the **Project** menu, choose **Export Template**. The **Export Template Wizard** opens.
29+
1. Select either **Project Template** or **Item Template** on the **Template Type** page, and follow the prompts in the wizard to export the template as a *.zip* file.
30+
1. If you select the option to **Automatically import the template into Visual Studio** in the **Export Template Wizard**, the wizard places the *.zip* file in the *%USERPROFILE%\Documents\Visual Studio \<version\>\Templates\ProjectTemplates* or *\\ItemTemplates* folder to make it available for selection in future projects. If you didn't select the option, paste the *.zip* file in the user template location manually.
31+
1. Delete the old template *.zip* file if necessary.
3932

4033
## Manually update an existing template
4134

42-
You can update an existing template without using the **Export Template Wizard**, by modifying the files in the compressed *.zip* file.
43-
44-
### To manually update an existing template
45-
46-
1. Locate the *.zip* file that contains the template. User project templates are located at *%USERPROFILE%\Documents\Visual Studio \<version\>\Templates\ProjectTemplates*.
35+
You can update an existing template without using the **Export Template Wizard** by manually modifying the files in the template *.zip* file.
4736

37+
1. Locate the *.zip* file that contains the template. User templates are located at *%USERPROFILE%\Documents\Visual Studio \<version\>\Templates\ProjectTemplates* or *\\ItemTemplates*.
4838
1. Extract the *.zip* file.
49-
5039
1. Modify or delete the current template files, or add new files to the template.
51-
5240
1. Open, modify, and save the *.vstemplate* XML file to handle updated behavior or new files.
5341

54-
For more information about the *.vstemplate* schema, see [Visual Studio template schema reference (extensibility)](../extensibility/visual-studio-template-schema-reference.md). For more information about what you can parameterize in the source files, see [Template parameters](../ide/template-parameters.md).
55-
56-
1. Select the files in your template, and from the right-click or context menu, and choose **Send to** > **Compressed (zipped) folder**.
57-
58-
The files that you selected are compressed into a *.zip* file.
59-
60-
1. Put the new *.zip* file in the same directory as the old *.zip* file.
42+
For more information about the *.vstemplate* schema, see [Visual Studio template schema reference (extensibility)](../extensibility/visual-studio-template-schema-reference.md). For more information about what you can parameterize in the source files, see [Template parameters](template-parameters.md).
6143

62-
1. Delete the extracted template files and the old template *.zip* file.
44+
1. In Windows Explorer, select the files for your template, including the *.vstemplate* file. Right-click the selection and select **Compress to** > **ZIP File**.
45+
1. Copy the resulting *.zip* file and paste it in the same directory as the old *.zip* file.
46+
1. Delete the extracted template files and delete the old template *.zip* file if necessary.
6347

6448
## Related content
6549

66-
- [Customize templates](../ide/customizing-project-and-item-templates.md)
67-
- [Create project and item templates](../ide/creating-project-and-item-templates.md)
50+
- [Customize templates](customizing-project-and-item-templates.md)
51+
- [Create project and item templates](creating-project-and-item-templates.md)
6852
- [Visual Studio template schema reference](../extensibility/visual-studio-template-schema-reference.md)
69-
- [Template parameters](../ide/template-parameters.md)
53+
- [Template parameters](template-parameters.md)

0 commit comments

Comments
 (0)