我正在尝试为Visual Studio 2019创建一个多项目解决方案模板。我可以在多个文件夹中成功添加多个项目。
下一步,我想将本地文件添加到解决方案的根目录中,或者甚至添加到诸如.gitignore
,nuget.config
等文件的文件夹中,但是到目前为止还算不上什么。
下面是我的.vstemplate
文件,注释行是我要添加的文件。我已经尝试过了,将行放在<SolutionFolder>
块中,将行放在ProjectCollection
块之外,...
<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>
任何帮助将不胜感激!