I completed the custom template project tutorial part I from msdn and got a basic project structure working and visible in the File - New - Project menu. Then i advanced to msdn part II and can't get past "Testing a Visual Studio Template" part.
When i add the .vstemplate file in the custom project template folder, set the Build Action
of all the files under my custom project template folder to ZipProject
and change the 2nd and 6th parameter of the [ProvideProjectFactory]
to null
and ".\\NullPath"
respectively, the File - New - Project doesn't display the custom template in the dialog anymore.
The template zip folder gets placed in the correct folder and i can open the custom projects previously created (this wouldn't work, if the project template wasn't installed), but i can't create any new custom projects as they aren't visible.
Does anybody have experience with creating custom project templates ?
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:
TemplateProjectOutputGroup;
Project
ProjectTemplates
False
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>
[ProvideProjectFactory(...
to "ProjectTemplates"
.Notes:
Templates
folder in your main project.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With