Visual Studio 2015 ASP.NET Core RC2: loss of Custom Item Templates
Asked Answered
M

1

2

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.

enter image description here

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?

Matronage answered 26/5, 2016 at 9:59 Comment(0)
G
6

This is fixed for me.

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

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

Regards,

Geniegenii answered 23/7, 2016 at 16:23 Comment(5)
Yes! It helps! Thank you!Matronage
It does not seems to be working in final NET Core. "DNX" keyword is obsolete now and i dont know what is replacement for final bits of NET Core?Baroness
This is what works for me: <ProjectType>DNX</ProjectType> <TemplateGroupID>SharedDotNetAndDotNetWeb</TemplateGroupID>Baroness
Thank you, <TemplateGroupID>SharedDotNetAndDotNetWeb</TemplateGroupID> works for VS 2015 Upd 3 + .NET Core 1.1Susquehanna
For VS2017 ASP .NET Core projects works <ProjectType>CSharp</ProjectType><TemplateGroupID>AspNetCore</TemplateGroupID> answerZaidazailer

© 2022 - 2024 — McMap. All rights reserved.