I created a VSIX Project
(using Visual Studio Extensibility) that references a C# Project Template
; it looks like this:
<TemplateData>
<Name>...</Name>
<Description>...</Description>
<Icon>...</Icon>
<ProjectType>Web</ProjectType>
<ProjectSubType>CSharp</ProjectSubType>
<TemplateGroupID>Web</TemplateGroupID>
<DefaultName>WebApplication</DefaultName>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<ProjectTemplateLink ProjectName="My Web Application">
Projects\WebApplication\ProjectTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="My Windows Library">
Projects\Library\ProjectTemplate.vstemplate
</ProjectTemplateLink>
</ProjectCollection>
</TemplateContent>
Everything works as expected, but my Project Template
appears always in the default Visual C#
root category of the Visual Studio New Project
form.
I would like to have it inside the Web category
.
Note:
<ProjectType>CSharp</ProjectType>
<ProjectSubType>Web</ProjectSubType>
=> The template appears in the default root category while
<ProjectType>Web</ProjectType>
<ProjectSubType>CSharp</ProjectSubType>
=> The Template is not visible!
You need to set the 'Category' property of the .vstemplate file in the Visual Studio Solution Explorer.
If you manually create the project template (creating a *.zip file that includes the project template) and not through an extensibility solution in visual studio, the subcategory depends on where on the file system you place the project template package. (The category still depends on the ProjectType element in .vstemplate).
For instance, if you create a zip file, where the .vstemplate ProjectType's value is "CSharp" and you place the zip file under (for vs 2010):
"%USERPROFILE%\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\MySubcategory1\MySubcategory2
Then the project will appear under Visual C# (due to the ProjectType) and then under "MySubcategory1\MySubcategory2" hierarchy (Due to the placement in the filesystem)
Mind that the project template would appear in the same hierarchy (Visual C# - MySubcategory1 - MySubcategory2) even if the zip file was not placed under the Visual C# subfolfer in the templates folder, like below:
"%USERPROFILE%\Documents\Visual Studio 2010\Templates\ProjectTemplates\MySubcategory1\MySubcategory2
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