I'm currenlty working on an add-in and require the functionality to add custom item templates to a project programatically.
I'm currently installing the templates (which are of a .zip format) in ..\Visual Studio 2010\Templates\ItemTemplates\.
From within the add-in I then call the following code:
string templateLocation = (solution as Solution2).GetProjectItemTemplate(templateName, language);
projectToAddTo.ProjectItems.AddFromTemplate(templateLocation, nameOfNewItem);
If the item template is for a C# file then if i use "CSharp" for the language variable and place the template in the Language Folder "Visual C#" or "Visual Web Developer\Visual C#" then this all works fine; the template is discovered and implemented correctly within Visual Studio.
However if I create a JScript or HTML template, the GetProjectItemTemplate method throws an exception if I supply the language as "JScript" or "HTML". I've tried placing the templates in both "ItemTemplates\JScript(HTML)" and "ItemTemplates\Visual Web Develerop\JScript(HTML)" with no luck.
Anyone have any ideas about what I'm doing wrong, what languages are supported for these custom item templates, what the language parameter and folder location should be?