locked
Adding folders to visual studio project template RRS feed

  • Question

  • I want to add the following folders to the project directory.

    include 

    dep/binary

    dep/lib

    dep/include

    So I created a project template and edited the MyTemplate.vstemplate file like below

    <VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
      <TemplateData>
        <Name>SFML</Name>
        <Description>&lt;No description available&gt;</Description>
        <ProjectType>VC</ProjectType>
        <ProjectSubType>
        </ProjectSubType>
        <SortOrder>1000</SortOrder>
        <CreateNewFolder>true</CreateNewFolder>
        <DefaultName>SFML</DefaultName>
        <ProvideDefaultName>true</ProvideDefaultName>
        <LocationField>Enabled</LocationField>
        <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
        <Icon>__TemplateIcon.ico</Icon>
      </TemplateData>
      <TemplateContent>
        <Project TargetFileName="ProjectS.vcxproj" File="ProjectS.vcxproj" ReplaceParameters="true">
          <ProjectItem ReplaceParameters="false" TargetFileName="$projectname$.vcxproj.filters">ProjectS.vcxproj.filters</ProjectItem>
          <ProjectItem ReplaceParameters="false" TargetFileName="main.cpp">SRC\main.cpp</ProjectItem>
          <Folder Name="dep">
            <Folder Name="binary"></Folder>
            <Folder Name="lib"></Folder>
            <Folder Name="include"></Folder>
          </Folder>
          <Folder Name="include"></Folder>
        </Project>
      </TemplateContent>
    </VSTemplate>

    But when I create a new project using this template, the folders are not there. What have I done wrong?

    • Moved by Shu 2017 Tuesday, April 28, 2015 5:18 AM from C++ forum
    Sunday, April 26, 2015 8:00 PM

Answers

All replies