Creating a project template in Visual Studio can save a bunch of time if you are planning on creating a bunch of similar projects. I have chosen to build a series of projects that resemble Microservice architecture I am calling Service Stacks. Creating Visual Studio solution templates seems like one of those things that is so easy there isn’t much documentation or many tutorials to help you do it. Elizabeth Andrews has a nice post that helped me take the initial step beyond a single project template to creating solution templates that contain several projects.
One of the first things I wanted to do is organize the projects into solution folders. I have seen other solution templates that divide projects into subfolders named things like Web, Backend, Winforms. The way you do this is in the
<ProjectCollection> section you simply wrap the
<ProjectTemplateLink> tags in a
<SolutionFolder> tag like this:
<TemplateContent> <ProjectCollection> <SolutionFolder Name="My Folder"> <ProjectTemplateLink> ProjectName="$safesolutionname$.Domain"> Domain\Domain.vstemplate </ProjectTemplateLink> </SolutionFolder> </ProjectCollection> </TemplateContent>
This results in the solution containing a folder called “My Folder” that contains the project “Domain”. Give it a try and let me know if it works for you.