Adding an folder to a multiple project Visual Studio 2010 Template
Asked Answered
C

1

7

I've been working on a full vertical stack template for Visual Studio (It's on Github if you'd like to help out: https://github.com/Adron/infrastructure

My problem is, I have not been able to add a folder for assemblies in the root of the solution. The individual project templates (which I have three in the overall parent solution template) have many individual elements, such as files and folders. But when I try to add anything like that to the parent template it reports that it is not valid in this XML schema/file.

My current solution XML file looks like this:

<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>

Any ideas on how to add folders or individual assets? Thanks...

Cruciate answered 21/3, 2011 at 15:8 Comment(2)
I assume you've tried adding them as Solution Items and that hasn't worked for your purposes? Right-click on Solution, Add, New Solution Folder, New Item, etc.Eastward
Not sure about your problem, but if i'm right you are trying to build a teamplte with multiple project that needs references. A solution folder is the solution, you got a subelement called SolutionFolder in ProjectCollection element. Problem is that it does not accepts files as xml. Didn't try, but could you test by adding files directly in the zip and setting an empty solution folder with the same name of the folder that containing dll.Antrorse
E
1

Here's part of my solution that includes Solution Items:

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

Does that help any?

Eastward answered 21/3, 2011 at 21:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.