I am looking for a sample on how to create an item template with Wizard in Visual Studio 2010. My requirement is when the user selects Add Item, I want to show a dialog where the user enters some input parameters. Then on pressing OK in the form we generate an XML fil开发者_Go百科e which we want to add to the project.
Thanks
I'd recommend you get the vsix featured in this link
http://blogs.msdn.com/b/visualstudio/archive/2010/03/04/creating-and-sharing-project-item-templates.aspx
and rename it as a zip file and open it up to start with. however the xml in the Item Templates themselves aren't all that complicated. Looking at one I just generated with the tool for a classic asp file.
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>Classic ASP</DefaultName>
<Name>Classic ASP</Name>
<Description>Adds script tag import ref</Description>
<ProjectType>Web</ProjectType>
<ProjectSubType>VisualBasic</ProjectSubType>
<SortOrder>10</SortOrder>
<Icon>__TemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<References />
<ProjectItem TargetFileName="$fileinputname$.asp" ReplaceParameters="true">ClassicASP.asp</ProjectItem>
</TemplateContent>
</VSTemplate>
精彩评论