0

I am trying to create dynamic number of projects during Visual Studio Project template (vstemplate) runs:

<TemplateContent>
    <ProjectCollection>
      <SolutionFolder Name="Setup1">
        <ProjectTemplateLink ProjectName="Setup1">
          ProjectTemplates\Setup\Setup.vstemplate
        </ProjectTemplateLink>
      </SolutionFolder>
    </ProjectCollection>
   </TemplateContent>

Can I somehow introduce variable to create n number of projects to be created?

Alex
  • 842
  • 11
  • 33

2 Answers2

0

The only way I found is to use EnvDTE object to create projects from temlate using Solution.AddFromTemplate method.

Alex
  • 842
  • 11
  • 33
0

The only way to do this is with a custom IWizard associated with your template, and use AddFromTemplate as Alex suggested. The trick is to call AddFromTemplate after the initial project is generated. I wrote and posted an example of this in The VSX Template Wizard blog entry. And the source is posted here.

Ed Dore
  • 2,013
  • 1
  • 10
  • 8