I am trying to create a multi-project solution template for Visual Studio 2019. I can successfuly add multiple project in multiple folders.
As a next step, I would like to add local files to the root of the solution or even in folders such as .gitignore
, nuget.config
,... files, but so far no luck.
Below is my .vstemplate
file, the commented lines are the files I am trying to add. I have tried it this way, putting the lines in a <SolutionFolder>
block, putting them outside of the ProjectCollection
block,...
<VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>Test Application</Name>
<Description>A project template for creating a basic Test Application</Description>
<ProjectType>CSharp</ProjectType>
<ProjectSubType>
</ProjectSubType>
<SortOrder>1000</SortOrder>
<CreateNewFolder>false</CreateNewFolder>
<DefaultName>MaestroApp</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
<LocationField>Enabled</LocationField>
<EnableLocationBrowseButton>true</EnableLocationBrowseButton>
<BuildOnLoad>true</BuildOnLoad>
<Icon>M.png</Icon>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<!--
<ProjectItem ReplaceParameters="false" TargetFileName=".gitattributes">.gitattributes</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName=".gitignore">.gitignore</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName="directory.build.props">directory.build.props</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName="nuget.config">nuget.config</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName="README.MD">README.MD</ProjectItem>-->
<SolutionFolder Name="Documents" CreateOnDisk="true"></SolutionFolder>
<SolutionFolder Name="src" CreateOnDisk="true">
<ProjectTemplateLink ProjectName="$projectname$" CopyParameters="true">
MaestroApplicationTemplate\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$projectname$.Data" CopyParameters="true">
MaestroApplicationTemplate.Data\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$projectname$.ProcessEngine" CopyParameters="true">
MaestroApplicationTemplate.ProcessEngine\MyTemplate.vstemplate
</ProjectTemplateLink>
</SolutionFolder>
<SolutionFolder Name="Test" CreateOnDisk="true">
</SolutionFolder>
</ProjectCollection>
</TemplateContent>
</VSTemplate>
Any help would be greatly appreciated!