简体   繁体   中英

How can a create a template solution in VS 2019 where projects lie in folders?

I've been following this tutorial of creating a multi-project template. It was sucessfull, even if I am using a newer version (3, not 2).

The thing is, that I would like to have some projects in some folders. So when I use/apply the template, I want to have certain projects in certain folders. I have attached two screenshots for a better undesrtanding.

在此处输入图片说明 在此处输入图片说明

The .vstemplate file looks like this:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup">
  <TemplateData>
    <Name>Multi-Project Template Sample</Name>
    <Description>&lt;Hacuna matata;</Description>
    <ProjectType>CSharp</ProjectType>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
        <ProjectCollection>
            <ProjectTemplateLink ProjectName="ConsoleApp1">
                Part1\ConsoleApp1\MyTemplate.vstemplate
            </ProjectTemplateLink>
            <ProjectTemplateLink ProjectName="Liviu">
                Part2\ClassLibrary1\MyTemplate.vstemplate
            </ProjectTemplateLink>
        </ProjectCollection>
    </TemplateContent>
</VSTemplate>

I tried combinations like ProjectName="Part1\\ConsoleApp1", but I've only got errors. I've been looking on the template parrameters , nothing promissing there.

Could somebody helpe me out? Many thanks!

You can just add a new folder to the solution using VS if you require a new folder.

在此处输入图片说明

You can add a new project to the folder then.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM