How can I create a Visual Studio project template that shows up in the Web category?
Asked Answered
S

1

8

I have created a project template that is installed via a VSIX extension. This is working fine, but it only shows up in the Visual C# category. I am having a lot of trouble figuring out how to get it to show up in the Visual C# > Web category.

I have tried following the documentation for ProjectType and ProjectSubType, but when I specify ProjectType=Web and ProjectSubType=CSharp, it doesn't show up at all.

Looking at .vstemplate files in the ProjectTemplatesCache folder, I see examples of project templates that have ProjectType=CSharp and ProjectSubType=Web, but for me that only makes it show up in the root Visual C# category. Doesn't show up in Visual C# > Web.

Any ideas?

Soke answered 18/3, 2013 at 19:34 Comment(0)
C
9

Do this, create a new folder for custom item templates, let's say it's:

c:\VS\Templates\Item

Now on VS go to Tools -> Options -> Projects and Solutions and set the User item templates location: option to the folder above, hit OK.

You will notice that inside c:\VS\Templates\Item folder some folders will be created. What you have to do is to create a new Web folder inside the Visual C# folder that has been created automatically, therefore you'll have:

c:\VS\Templates\Item\Visual C#\Web

Drop the zip file with the item template there and the item will show up under the Web category when you are creating new items. You can create other categories as well just by creating new folders under Visual C# folder (or any other category folder for that matter).

Good luck.

Commentative answered 18/4, 2013 at 13:37 Comment(2)
What should be done when templates are packaged using VSIX?Wastebasket
@Dheeraj V.S.: In your VSIX project, create a sub folder under your ProjectTemplates or ItemTemplates folder and put the templates there. The sub folder name will be the category name.Castellano

© 2022 - 2024 — McMap. All rights reserved.