我正在使用 Visual Studio 项目模板,但在我的解决方案中,我有 6 个项目,并且我想包含我的项目模板中的所有项目。项目代码项目是这个:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>WebAPI.cs</DefaultName>
<Name>WebAPI</Name>
<Description><No description available></Description>
<ProjectType>CSharp</ProjectType>
<SortOrder>10</SortOrder>
<Icon>__TemplateIcon.png</Icon>
</TemplateData>
<TemplateContent>
<Folder Name="Base" TargetFolderName="Base">
<Folder Name="Interface" TargetFolderName="Interface">
<ProjectItem ReplaceParameters="true" TargetFileName="I$fileinputname$.cs">IPesquisarEstruturaSIIMN.cs</ProjectItem>
</Folder>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$N.cs">PesquisarEstruturaSIIMN.cs</ProjectItem>
</Folder>
</TemplateContent>
</VSTemplate>
我的问题是我的问题是如何更改项目模板的项目目标?
最佳答案
模板定义适用于整个 Visual Studio。
为了让 Visual Studio 能够找到它,请将 .vstemplate、PesquisarEstruturaSIIMN.cs、IPesquisarEstruturaSIIMN.cs 和 __TemplateIcon.png 文件复制到项目模板文件夹下的新文件夹中。
例如:C:\Users\MyUser\Documents\Visual Studio 2013\Templates\ItemTemplates\MyTemplate
然后重新启动 Visual Studio,右键单击每个项目,选择“添加”,然后选择“新项目”。您应该会在 Visual C# Items 下看到您的模板作为一个选项。
关于c# - 在 Visual Studio 模板中更改项目文件夹路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29683407/