Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 381
Joseph Gabriel Avatar asked Mar 18 '13 19:03

Joseph Gabriel


People also ask

How do I create a custom template in Visual Studio?

Go to Documents\Visual Studio Version\Templates\ProjectTemplates and create a new folder to separate your template from the default templates of visual studio. You will see the newly created template as shown below. Give the name of the project and click on 'Ok' button.

How do I create a multi project template?

Create a multi-project template from an existing solutionOn the Project menu, choose Export Template. The Export Template Wizard opens. On the Choose Template Type page, select Project Template. Select one of the projects that you want to export to a template, and then choose Next.


1 Answers

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.

like image 89
Anderson Fortaleza Avatar answered Nov 15 '22 10:11

Anderson Fortaleza