c# - How to add a jscript or html item template via an add-in in visual studio -


i'm currenlty working on add-in , require functionality add custom item templates project programatically.

i'm installing templates (which of .zip format) in ..\visual studio 2010\templates\itemtemplates\.

from within add-in call following code:

string templatelocation = (solution solution2).getprojectitemtemplate(templatename, language); projecttoaddto.projectitems.addfromtemplate(templatelocation, nameofnewitem); 

if item template c# file if use "csharp" language variable , place template in language folder "visual c#" or "visual web developer\visual c#" works fine; template discovered , implemented correctly within visual studio.
if create jscript or html template, getprojectitemtemplate method throws exception if supply language "jscript" or "html". i've tried placing templates in both "itemtemplates\jscript(html)" , "itemtemplates\visual web develerop\jscript(html)" no luck.

anyone have ideas i'm doing wrong, languages supported these custom item templates, language parameter , folder location should be?

from having looked bit more seems parameter language in string solution2.getprojectitemtemplate(string templatename, string language) language type of project item template targetting. hence whether actual item in template java file or html file, project still csharp or visualbasic , should passed in language parameter.

furthermore, in location custom item , project templates, doesnt matter folder called, visual c#, visual basic, visual web developer\jscript. name of folders affects how appears in add new item dialog , how stored in cache.

also, templatename parameter specify when calling getprojectitemtemaplate should have full reletive path beneath itemtemplates folder. although work without it, if have more 1 template same name in different locations you'll first 1 returned vs.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -