【发布时间】:2011-03-21 15:08:23
【问题描述】:
我一直在为 Visual Studio 开发一个完整的垂直堆栈模板(如果你想帮忙,它在 Github 上:https://github.com/Adron/infrastructure
我的问题是,我无法在解决方案的根目录中添加程序集文件夹。单个项目模板(我在整个父解决方案模板中有三个)具有许多单独的元素,例如文件和文件夹。但是,当我尝试将类似的内容添加到父模板时,它会报告它在此 XML 架构/文件中无效。
我当前的解决方案 XML 文件如下所示:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup">
<TemplateData>
<Name>ASP.NET MVC 3 + Razor + Machine.Specifications Infrastructure Solution</Name>
<Description>This Visual Studio Template provides the following pieces for getting a kick start when building well designed web sites using good patterns.</Description>
<EnableEditOfLocationField>true</EnableEditOfLocationField>
<EnableLocationBrowseButton>true</EnableLocationBrowseButton>
<ProvideDefaultName>true</ProvideDefaultName>
<Icon>Icon.ico</Icon>
<ProjectType>CSharp</ProjectType>
<SortOrder>1000</SortOrder>
<CreateNewFolder>true</CreateNewFolder>
<DefaultName>Infrastructure</DefaultName>
<LocationField>Enabled</LocationField>
<PreviewImage>Preview.png</PreviewImage>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<ProjectTemplateLink ProjectName="Infrastructure.Web">Web\MyTemplate.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="Infrastructure.Specifications">Specifications\MyTemplate.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="Infrastructure.Data">Data\MyTemplate.vstemplate</ProjectTemplateLink>
</ProjectCollection>
</TemplateContent>
</VSTemplate>
关于如何添加文件夹或单个资产的任何想法?谢谢...
【问题讨论】:
-
我假设您已尝试将它们添加为解决方案项目,但这对您的目的不起作用?右键单击解决方案,添加,新解决方案文件夹,新项目等。
-
不确定您的问题,但如果我是对的,您正在尝试构建一个包含多个需要参考的项目的团队。解决方案文件夹是解决方案,您在 ProjectCollection 元素中有一个名为 SolutionFolder 的子元素。问题是它不接受文件作为 xml。没试过,但你可以通过直接在 zip 中添加文件并设置一个与包含 dll 的文件夹同名的空解决方案文件夹来测试。
标签: visual-studio-2010 visual-studio-templates