When creating a Visual Studio 2012 extension, you can actually create a separate project for each project template you'd like to ship. The template for creating these projects is located at the following path in the New Project wizard. You'll need one project for each template you are creating.
Visual C# → Extensibility → C# Project Template
Your main extension project (the one that produces the VSIX file) will then need to do the following:
- Add a reference to the project for your new project template
- Select the reference and press F4 to jump to the Properties window. Make sure the following properties are set.
- Output Groups Included in VSIX:
TemplateProjectOutputGroup;
- Template Type:
Project
- VSIX Sub Path:
ProjectTemplates
- Reference Output Assembly:
False
- Output Groups Included in VSIX:
- Open your
source.extension.vsixmanifest
and add the following under<Content>
(You only need this once, regardless of the number of project templates are referencing.)<ProjectTemplate>ProjectTemplates</ProjectTemplate>
- Change the 6th argument of
[ProvideProjectFactory(...
to"ProjectTemplates"
.
Notes:
- After this process, you will no longer have a
Templates
folder in your main project.