We have made several Blazor Templates in Visual Studio 2022, for single project solutions. This is our first attempt to create a Blazor Template with multiple projects in the same solution.
I have followed the Microsoft Guide for creating a multi-project template:
- I have exported each of the two projects individually and unzipped them into a root folder
- I have added a
.vstemplatefile in the root folder - I zipped the full template and placed inside my VS Template folder and I can see it as a template option, when I launch VS
The problem that I am having is that I get an error:
The template type is unknown, check the project type node in the .vstemplate file
However, my .vstemplate file clearly sets the project type as C# (see below).
Full .vstemplate file (copied from Microsoft):
<VSTemplate Version="3.0.0" Type="Solution" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"><TemplateData><Name>TestTemplate3</Name><Description>A Blazor solution template with multiple projects.</Description><Icon>__TemplateIcon.ico</Icon><ProjectType>CSharp</ProjectType><ProjectSubType></ProjectSubType></TemplateData><TemplateContent><ProjectCollection><!-- Link to the first project template's vstemplate file --><ProjectTemplateLink ProjectName="Project1"> BlazorEmpireTemplate\MyTemplate.vstemplate</ProjectTemplateLink><!-- Link to the second project template's vstemplate file --><ProjectTemplateLink ProjectName="Project2"> BlazorEmpireTemplate.Data\MyTemplate.vstemplate</ProjectTemplateLink><!-- Add more ProjectTemplateLink elements for each project --></ProjectCollection></TemplateContent></VSTemplate>Working with the .vstemplate file is new to me and I am a bit lost.
I do have the project type as CSharp - so why would it be throwing that error?