i'm creating project template web on visual studio 2013 update 4.
create project of "c# project template" type.
edit vstemplate file to: (as described at: https://msdn.microsoft.com/en-us/library/ms171386.aspx)
<projecttype>web</projecttype> <projectsubtype>csharp</projectsubtype> then added vsix project , add asset, template project. vsixmanifest assets section in xml editor:
<assets> <asset type="microsoft.visualstudio.projecttemplate" d:source="project" d:projectname="mytestprojecttemplate" d:targetpath="|mytestprojecttemplate;templateprojectoutputgroup|" path="projecttemplates" d:vsixsubpath="projecttemplates" /> </assets> if sign projecttype csharp project template listed under "csharp" when it's listed web desribed above it's not displayed @ all.
any ideas?
i hope someone.
have set vstemplate:
<projecttype>csharp</projecttype> <templategroupid>web</templategroupid> in vstemplate file properties (f4) (solution explorer) have set category web.
if examine compilation result output it's :
bin\debug\projecttemplates\csharp\web\1033\<your template zip> check out csproj file of template project , see:
<itemgroup> <vstemplate include="mytestprojecttemplate.vstemplate"> <subtype>designer</subtype> <outputsubpath>web</outputsubpath> </vstemplate> </itemgroup> this category-> web result. (i wondered why don't see definition effect in vstemplate file... answer. it's definition in csproj file).
add vsix , project project template asset , works expected.
when understand issue path template zip in it's simpler , can solved multiple project template well.
now multiple project template!
in scenario have zip file root vstemplate , sub folder each contained project.
the root vstemplate file has signed with:
<projecttype>csharp</projecttype> <templategroupid>web</templategroupid>at vsix project folder have add following folders: (close visual studio , outside visual studio in windows).
projecttemplates\csharp\web\1033add template zip under folder 1033. (outside visual studio)
open visual studio, select "show files" in solution explorer pane.
roll down template zip file in vsix project, right click , select "include in project".at template zip file properties, change build action content, copy , include in vsix true.
at vsixmanifest editor (double click it), add asset. project template->file on filesystem->the path zip (has in drop down box option).
compile vsix project. open output folder (usually bin\debug) , see result vsix file @ root folder , following folders tree next it. projecttemplates\csharp\web\1033\.
run vsix , see project template under "web".
a moment of silence. let's remember programmers fell in bloody battle. :-)
Comments
Post a Comment