[英]How to create a multi project template in visual studio 2013?
I followed the How to: Create Multi-Project Templates article to create a template that will generate a solution containing 4 projects.我按照如何:创建多项目模板文章创建了一个模板,该模板将生成一个包含 4 个项目的解决方案。 My Root.vstemplate file contains the following我的 Root.vstemplate 文件包含以下内容
<VSTemplate Version="2.0.0" Type="ProjectGroup"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>Yugasat BeyondAdmin</Name>
<Description>The Yugasat BeyondAdmin Project Template</Description>
<Icon>Icon.ico</Icon>
<ProjectType>CSharp</ProjectType>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<ProjectTemplateLink ProjectName="PresentationLayer">
PresentationLayer\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="BusinessLogicLayer">
BusinessLogicLayer\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="BusinessLogicLayerAPI">
BusinessLogicLayerAPI\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="DataAccessLayer">
DataAccessLayer\MyTemplate.vstemplate
</ProjectTemplateLink>
</ProjectCollection>
</TemplateContent>
I copied the template to the [drive]:\\Users\\[user]\\Documents\\Visual Studio 2013\\Templates\\ProjectTemplates\\
folder.我将模板复制到[drive]:\\Users\\[user]\\Documents\\Visual Studio 2013\\Templates\\ProjectTemplates\\
文件夹。 The problem is that the template is not listed as a multi project template问题是模板没有列为多项目模板
So I can create the individual projects, but not a solution containing all 4 my projects.所以我可以创建单个项目,但不能创建包含我所有 4 个项目的解决方案。 The content of my template folder looks like我的模板文件夹的内容看起来像
Ensure that the ".vstemplate" file (for each project) has the same name as the project that it resides in.确保“.vstemplate”文件(对于每个项目)与它所在的项目具有相同的名称。
ie Presentation Layer should have a PresentationLayer.vstemplate即表示层应该有一个 PresentationLayer.vstemplate
Its not necessary to create a VSIX Installer for this but the link has a visual representation of what is expected in the "root.vstemplate".没有必要为此创建 VSIX 安装程序,但该链接具有“root.vstemplate”中预期内容的可视化表示。
Also, once this has been completed and your template folder has been copied to ~/My Documents/Visual Studio 2013\\Templates\\ProjectTemplates\\, the option should be found in the "Visual C#" section of Create New Project.此外,完成此操作并将您的模板文件夹复制到 ~/My Documents/Visual Studio 2013\\Templates\\ProjectTemplates\\ 后,应在“创建新项目”的“Visual C#”部分中找到该选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.