【问题标题】:How call a wizard to add new Item Template如何调用向导添加新的项目模板
【发布时间】:2019-04-16 11:04:05
【问题描述】:

我有一个通过向导生成的项目模板。 现在我想通过同一个向导添加一个新的项目模板。 添加新项目模板时如何调用向导。

例子:

[添加到项目模板]

[向导/表格]

[添加新项目模板]

[显示向导模板]

[显示新项目/类]

物品模板代码:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>class1.cs</DefaultName>
    <Name>Myproject class1</Name>
    <Description>Myproject Class</Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>Myprojectclass1.png</Icon>
  </TemplateData>
  <TemplateContent>
    <References>
      <Reference>
        <Assembly>System</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Linq</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Threading.Tasks</Assembly>
      </Reference>
    </References>
    <ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">class1.cs</ProjectItem>
    <CustomParameters>  
        <CustomParameter Name="$username$" Value="$safeitemrootname$"/> 
        <CustomParameter Name="$rootnamespace$" Value="$safeitemrootname$"/>
        <CustomParameter Name="$registeredorganization$" Value="$safeitemrootname$"/>
    </CustomParameters>  
  </TemplateContent>
    <WizardExtension>
    <Assembly>MyProjectWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=f7a1fcb8d457e160</Assembly>
    <FullClassName>MyProjectWizard.WizardImplementation</FullClassName>
  </WizardExtension>
</VSTemplate>

【问题讨论】:

    标签: c# visual-studio wizard vsix itemtemplate


    【解决方案1】:

    我已经找到解决办法了,没有key.snk没有其他方法可以调用模板项。

    因为当我调用 itemtemplate 时,我必须实现我的项目,所以我选择了创建的项目,唯一的方法是通过 key.snk。

    如果他们有不同的表格请回复这个问题,我想知道是否有更多的方法可以调用项目模板。

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-03
      • 1970-01-01
      相关资源
      最近更新 更多