Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Project template in the Web Category

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.

enter image description here

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!

like image 385
Bidou Avatar asked Jun 20 '13 12:06

Bidou


2 Answers

You need to set the 'Category' property of the .vstemplate file in the Visual Studio Solution Explorer.

enter image description here

like image 69
David Gardiner Avatar answered Sep 21 '22 06:09

David Gardiner


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)

Project Type Subcategories

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
like image 42
Thanasis Ioannidis Avatar answered Sep 20 '22 06:09

Thanasis Ioannidis