带向导的Visual Studio项目模板

Ven*_*nki 5 visual-studio-2010

我正在寻找有关如何在Visual Studio 2010中使用向导创建项目模板的示例。我的要求是,当用户选择“添加项目”时,我想显示一个对话框,供用户输入一些输入参数。然后在按OK的形式时,我们生成一个XML文件,该文件要添加到项目中。

谢谢

Ter*_*nce 0

我建议您获取此链接中的 vsix
http://blogs.msdn.com/b/visualstudio/archive/2010/03/04/creating-and-sharing-project-item-templates.aspx
并重命名它作为 zip 文件并打开它开始。然而,项目模板本身的 xml 并不那么复杂。看一下我刚刚使用该工具生成的一个经典 asp 文件。


<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>