I'm currently putting together a .vsix which contains various item and project templates using SideWaffle and TemplateBuilder v1.1.4.9-beta. When running the project in an experimental instance, I can see all of the project templates where they should be, but the item templates aren't available in the Add New Item dialog for any project types except Console Applications. The behaviour is the same if I compile the project to a release .vsix and install it for Visual Studio the traditional way.
Folder structure for one example template for reference:
The content of CSharp.vestemplate:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<ProjectType>CSharp</ProjectType>
<DefaultName>my_layout.xml</DefaultName>
<Name>My Layout</Name>
<Description>My Description</Description>
<Icon>icon.png</Icon>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<TemplateID>65197798-4682-45e6-9bf4-d2d9e2929527</TemplateID>
<SortOrder>1000</SortOrder>
</TemplateData>
<TemplateContent>
<References />
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$.xml">my_layout.xml</ProjectItem>
</TemplateContent>
</VSTemplate>
I've already tried:
- Setting values for ShowByDefault, ProjectSubType, and TemplateGroupID in the .vstemplate
- Fiddling with the folder structure
- Comparing my .csproj and .vsixmanifest files line-by-line with those of other template packs, like SideWaffle
but all to no avail so far.
Despite Microsoft's documentation lacking any reference to them, the
TemplateGroupId
typesMonoAndroid
andXamarin.iOS
are available, and must be specified within the template's.vstemplate
. Adding the following element to a TemplateData element gets the template to show up correctly:<TemplateGroupID>MonoAndroid</TemplateGroupID>
It's fairly frustrating that the available TemplateIDs don't seem to be properly documented anywhere, and the ones that do work follow seemingly random naming conventions (one would expect
MonoAndroid
andMonoTouch
, orXamarin.Android
andXamarin.iOS
, but instead onlyMonoAndroid
andXamarin.iOS
actually work...).