Edit .vstemplate file of project before it is a template

557 views Asked by At

I'm trying to follow this guide to create a project template in Visual Studio 2013.

At number 3 I go to "How to: Substitute Parameters in a Template" and at number 2 is the instruction "In the .vstemplate file for the template, locate the ProjectItem element that includes this file."

My problem is that I don't have a .vstemplate file until I've done step number 4 in the first guide, which is to actually create/export the project to a template.

Is there a .vstemplate file in every project and I'm just missing it, or are the instructions wrong? Should I edit the .vstemplate file after I've created the template?

1

There are 1 answers

0
Zereges On

The instructions are wrong. The correct process would be:

  • Create a project, modify it to suit your needs
  • Project -> Export template...
  • Deselect Automatically import the template into Visual Studio
  • Unzip the exported template, modify it to suit your needs (including the .vstemplate file)
  • Rezip the template and share (or place into %USERPROFILE%\Documents\Visual Studio <version>\Templates\ProjectTemplates (change <version> to year, e.g. 2022)