c# - 如何调用向导添加新的项目模板
问题描述
我有一个通过向导生成的项目模板。现在我想通过同一个向导添加一个新的项目模板。添加新项目模板时如何调用向导。
例子:
[添加到项目模板]
[向导/表格]
[添加新的项目模板]
[显示向导模板]
[显示新项目/类别]
项目模板代码:
<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>
解决方案
我已经找到了解决方案,没有key.snk没有其他方法可以调用模板项。
因为当我调用 itemtemplate 时,我必须实现我的项目,我选择了创建的项目,唯一的方法是通过 key.snk。
如果他们有不同的表格,请回答这个问题,我想知道是否有更多方法可以调用 Item 模板。
推荐阅读
- c++ - 数组 C++ 问题中的最大和第二大数
- html - CSS 样式规则
- django - 有没有办法让 Django 接受 USE_TZ=True 的天真日期时间,或者抑制警告?
- parallel-processing - 不同的 Jupyter Notebook 会自动并行运行吗?
- python - 如何在 CuPy 中分配倾斜的 2D 内存?
- python - 如何在序列中找到最长长度的相邻整数值
- javascript - 在 ES6 中合并 2 个嵌套对象/选择性覆盖
- python - 如何在 Pytorch 中将多个矩阵对角线组合成一个大矩阵
- python - 如果它们具有相同的流,如何在数据框中对数据进行分组?
- mysql - MySQL,获取多行集合中一行的位置