On an article, we made the project template, this article I made the item template
First, from the project where we need to export the template, file---Export template, eject the Export Template wizard dialog box
Select the item template and click Next
Select the items you want to export and click Next
Select the class library to reference
Modify the template name and click Finish
Then, unzip the generated zip file,
Open a. vstemplate file
<VSTemplateVersion= "3.0.0"xmlns= "http://schemas.microsoft.com/developer/vstemplate/2005"Type= "Item"> <TemplateData> <DefaultName>CodeTimerTemplate.cs</DefaultName> <Name>Codetimertemplate</Name> <Description><No description available></Description> <ProjectType>CSharp</ProjectType> <SortOrder>10</SortOrder> <Icon>__templateicon.ico</Icon> </TemplateData> <TemplateContent> <References> <Reference> <Assembly>System</Assembly> </Reference> </References> <ProjectItemsubtype= "Code"TargetFileName= "$fileinputname $.cs"ReplaceParameters= "true">CodeTimer.cs</ProjectItem> </TemplateContent></VSTemplate>
Modify TemplateData, modify information about the template
Modify the TemplateContent to change the targetfilename to what you want.
Open the item file CodeTimer.cs, do some of your own modifications
Using system;using system.diagnostics;using system.runtime.interopservices;using system.threading;namespace $ rootnamespace${public Static class $safeitemname $ {public static void Initialize ()
Finally compress the zip file into
(vs installation directory) \visual Studio 2013\templates\itemtemplates
Then you can see your item template in the new item in VS.
Visual Studio Project template Authoring (ii)