Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio Visual Studio 2015模板-跨多个项目的多项目模板_Visual Studio_Templates - Fatal编程技术网

Visual studio Visual Studio 2015模板-跨多个项目的多项目模板

Visual studio Visual Studio 2015模板-跨多个项目的多项目模板,visual-studio,templates,Visual Studio,Templates,我们正在尝试创建一个项目模板,该模板由1个项目中的3个文件和另一个项目中的1个文件组成(两个项目位于同一个解决方案中) 我可以成功地为一个项目中的3个文件生成一个模板,然后为另一个文件生成一个单独的模板,但我似乎找不到一种方法来组合这些文件,因此当我添加模板时,它会将文件添加到2个项目中 模板1(在第一个项目中) Template.ascx 模板测试 CSharp 10 __TemplateIcon.ico SampleControlDesign.ascx SampleControlSubmi

我们正在尝试创建一个项目模板,该模板由1个项目中的3个文件和另一个项目中的1个文件组成(两个项目位于同一个解决方案中)

我可以成功地为一个项目中的3个文件生成一个模板,然后为另一个文件生成一个单独的模板,但我似乎找不到一种方法来组合这些文件,因此当我添加模板时,它会将文件添加到2个项目中

模板1(在第一个项目中)


Template.ascx
模板测试
CSharp
10
__TemplateIcon.ico
SampleControlDesign.ascx
SampleControlSubmit.ascx
SampleControlRender.ascx
模板2(在第二个项目中)


Template2.cs
模板2
用于创建控件域模型的模板
CSharp
10
__TemplateIcon.ico
SampleControl.cs
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
   <TemplateData>
    <DefaultName>Template.ascx</DefaultName>
    <Name>Template Test</Name>
    <Description></Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References />
    <ProjectItem SubType="" TargetFileName="/Areas/Design/Views/Shared/EditorTemplates/$fileinputname$.ascx" ReplaceParameters="true">SampleControlDesign.ascx</ProjectItem>
    <ProjectItem SubType="" TargetFileName="/Areas/Submit/Views/Shared/EditorTemplates/$fileinputname$.ascx" ReplaceParameters="true">SampleControlSubmit.ascx</ProjectItem>
    <ProjectItem SubType="" TargetFileName="/Areas/Submit/Views/Render/$fileinputname$.ascx" ReplaceParameters="true">SampleControlRender.ascx</ProjectItem>
  </TemplateContent>
</VSTemplate>
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>Template2.cs</DefaultName>
    <Name>Template 2</Name>
    <Description>Template for the creation of a controls domain model</Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References />
    <ProjectItem SubType="" TargetFileName="/Models/Controls/$fileinputname$.cs" ReplaceParameters="true">SampleControl.cs</ProjectItem>
  </TemplateContent>
</VSTemplate>