使用VS 2015 Update 3和.NET Core 1.1 RTM,我已经导出了自定义项目模板,以使我的团队可以更轻松地创建所需的样板。生成的.vstemplate文件如下所示:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>Mercury Repository.cs</DefaultName>
<Name>Mercury Repository</Name>
<Description>New Mercury Repository inherits from DB Context, implements Mercury stack standards</Description>
<ProjectType>DNX</ProjectType>
<SortOrder>10</SortOrder>
<Icon>__TemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<References />
<ProjectItem SubType="" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">AgimsRepository.cs</ProjectItem>
</TemplateContent>
</VSTemplate>
当我将压缩包放在适当的文件夹\ Filesrv-agct \ UserData \ username \ My Documents \ Visual Studio 2015 \ Templates \ ItemTemplates.NET Core中时(这是在我的工具/选项/项目和解决方案/常规中指定的模板文件夹设置),Visual Studio不会选择它。我认为这是自早期版本以来已更改的ProjectType,但是我找不到关于它的任何文档,并且我尝试了以下所有类型:
这些都不起作用。有谁知道如何使它工作?
好的,我已经在这个问题的评论中找到了解决方案。
在VS2015 Update 3 + .NET Core 1.1.0 RTM中对我有用的是:
<ProjectType>DNX</ProjectType
<TemplateGroupID>SharedDotNetAndDotNetWeb</TemplateGroupID>
对该问题给出的实际答案对我不起作用,但似乎适用于.NET Core 1.0 RC2工具预览1(因此,可能是.NET Core 1.0-我无法对其进行测试):
<ProjectType>DNX</ProjectType>
<TemplateGroupID>DotNetWeb</TemplateGroupID>
我很想知道是谁想到了这些,为什么需要在版本之间进行更改,等等。无论如何,希望这可以节省我在此上面花费的时间!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句