简体   繁体   English

如何在 Visual Studio 2013 中创建多项目模板?

[英]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.

相关问题 如何创建Visual Studio 2017多模板VSIX项目? - How to create Visual Studio 2017 multi template VSIX project? visual Studio 2013项目安装程序如何创建自定义操作 - visual studio 2013 project installer how to create custom actions Visual Studio 2013:无法创建MVC项目 - Visual Studio 2013: Cannot Create MVC project 多项目模板Visual Studio 2017 - Multi project template Visual Studio 2017 当将项目模板用于Visual Studio 2013时,此调试另一个项目 - When used project template for Visual Studio 2013 this debugging another project 如何将Visual Studio 2013项目降级为Visual Studio 2008项目? - How to downgrade a Visual Studio 2013 project to a Visual Studio 2008 project? Visual Studio 2013/2015测试项目模板 - 适用于NUnit? - Visual Studio 2013/2015 Test Project Template - for NUnit? 如何在Visual Studio 2013中编辑ASP.Net MVC C#项目模板文件? - How can I edit ASP.Net MVC C# project template files in Visual Studio 2013? 如何使用Visual Studio 2013创建Uml图 - How to create a Uml Diagram with Visual Studio 2013 如何在Visual Studio 2013中创建动态表? - How to create a dynamic table in Visual Studio 2013?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM