Below process is for multi projects
Example source code: https://github.com/Stopaloglu16/WorkerServiceTemplate
How to create a template
Create new blank solution and create projects.
Domain (Class Library)
WorkerServiceTemp (WorkerService)
TestProjectTemp (xUnit)
Project --> Export Template
Select 'Project Template', select project source from dropdown
Enter a name and optional description, icon image, and preview image for your template
Unselect 'Automatically import the template into Visaul Studio'
Repeat step 2 for each project
It will create a zip file under folder. %USERPROFILE%\Documents\Visual Studio 2022\My Exported Templates
How to motifiy
Creating empty folder
Moving 3 project zip file and unzip them
Copy .vstemplate extension file from one project and open with Notepad to edit
<VSTemplate Version="3.0.0" Type="ProjectGroup"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>Multi-Project Template Sample</Name>
<Description>An example of a multi-project template</Description>
<Icon>Icon.ico</Icon>
<ProjectType>CSharp</ProjectType>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<SolutionFolder Name="Source">
<ProjectTemplateLink ProjectName="$projectname$">
WorkerServiceTemp\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="Domain">
Domain\MyTemplate.vstemplate
</ProjectTemplateLink>
</SolutionFolder>
<SolutionFolder Name="Test">
<ProjectTemplateLink ProjectName="$projectname$.Tests">
TestProjectTemp\MyTemplate.vstemplate
</ProjectTemplateLink>
</SolutionFolder>
</ProjectCollection>
</TemplateContent>
</VSTemplate>
Save each file .vstemplate location and change project name with $...$ if you want to rename it
Save .vstemplate
Choose .vstemplate and project folders then Zip. Don't move the main folder!!!
Move to %USERPROFILE%\Documents\Visual Studio 2022\Templates\ProjectTemplates