我一直在为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>
有关如何添加文件夹或个人资产的任何想法?感谢...
答案 0 :(得分:1)
以下是我的解决方案的一部分,其中包括解决方案项目:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8C6F0281-2022-4F98-A856-590C5FE26BC1}"
ProjectSection(SolutionItems) = preProject
..\Build.bat = ..\Build.bat
..\Build.proj = ..\Build.proj
..\ClickToBuild.bat = ..\ClickToBuild.bat
..\DeployStage.bat = ..\DeployStage.bat
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
Performance1.psess = Performance1.psess
EndProjectSection
EndProject
这对你有帮助吗?