Creating and deploying solution item templates
A solution item template is an VS item template that is available at the Solution level.
The list of item templates that you see on the Add New Item dialog is constructed by VS by looking for installed templates on certain locations.
There are two types of templates:
- Installed Templates
- Custom Templates
The location for the custom templates can be modified:
So lets see again the locations:
The problem is that for a solution item template we DON'T have a language, there is no project that act as a container because we want to add the item directly to the solution.
So how we can create and deploy a solution template? The answer is by using the General category:
And the same category for the ProjectType node in the vstemplate file:
<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>Class1.cs</DefaultName>
<Name>MyClass</Name>
<Description>My Item Template</Description>
<ProjectType>General</ProjectType>
<SortOrder>10</SortOrder>
<Icon>MyClass.ico</Icon>
</TemplateData>
<TemplateContent>
<References />
<ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">Class1.cs</ProjectItem>
</TemplateContent>
</VSTemplate>
Pablo