Visual Studio 2015 ASP.NET Core RC2: loss of Custo

2020-02-13 03:15发布

问题:

I use Visual Studio 2015 update 2 Community Edition.

With Visual Studio DotNetCore RC1 tools I had my custom Item Template under DNX section. I can't provide proving screenshot because I already moved to DotNetCore RC2 Tools Preview 1. With the last set of tools I lost my Item Template.

I tried to change ProjectType and ProjectSubType from DNX to CSharp/Web, tried to put component in different places with no success.

The last .vstemplate file has the following content

<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>ReactComponent</DefaultName>
    <Name>ReactComponent</Name>
    <Description>ReactComponent</Description>
    <TemplateID>Chandrush.ReactComponent</TemplateID>
    <ProjectType>CSharp</ProjectType>
    <ProjectSubType>Web</ProjectSubType>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References />
    <ProjectItem TargetFileName="$fileinputname$\$fileinputname$.tsx" ReplaceParameters="true">ReactComponent.tsx</ProjectItem>
    <ProjectItem TargetFileName="$fileinputname$\package.json" ReplaceParameters="true">package.json</ProjectItem>
    <ProjectItem TargetFileName="$fileinputname$\$fileinputname$.scss" ReplaceParameters="true">ComponentStyle.scss</ProjectItem>
  </TemplateContent>
</VSTemplate>

Do anybody know the solution, to get custom Item Templates back to VS2015u2 with .NetCore RC2 preview1 tools?

回答1:

This is fixed for me.

Regarding your .vstemplate file, you must have to change these properties :

<ProjectType>DNX</ProjectType>  
<TemplateGroupID>DotNetWeb</TemplateGroupID>

Regards,