aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.03k stars 518 forks source link

How to install and use Microsoft.AspNetCore.SpaTemplates for dotnet core SDK < 2.0.0 #1327

Closed sntnupl closed 7 years ago

sntnupl commented 7 years ago

Is there any way I can dotnet new --install Microsoft.AspNetCore.SpaTemplates::* without migrating to dotnet core 2.0? I am on MacOS 10.11 and hence can't install dotnet core SDK 2.0.

I currently have dotnet core SDK 1.0.4 installed in my setup. After I ran the above command, the commands seemed to complete successfully, but dotnet new --help does not show all SPA templates:

Templates                          Short Name      Language      Tags
-------------------------------------------------------------------------------
Console Application                console         [C#], F#      Common/Console
Class library                      classlib        [C#], F#      Common/Library
Unit Test Project                  mstest          [C#], F#      Test/MSTest
xUnit Test Project                 xunit           [C#], F#      Test/xUnit
ASP.NET Core Empty                 web             [C#]          Web/Empty
ASP.NET Core Web App               mvc             [C#], F#      Web/MVC
ASP.NET Core with Aurelia          aurelia         [C#]          Web/MVC/SPA
ASP.NET Core with Knockout.js      knockout        [C#]          Web/MVC/SPA
ASP.NET Core with Vue.js           vue             [C#]          Web/MVC/SPA
ASP.NET Core Web API               webapi          [C#]          Web/WebAPI
Solution File                      sln                           Solution

Notice that Angular, React, ReactRedux etc templates are missing. Also, although templates like vue seem to be available, running dotnet new vue results in the following error:

Option variant - for canonical TargetFrameworkOverride was already defined for canonical skipRestore
   at Microsoft.TemplateEngine.Cli.ExtendedCommandParser.MapTemplateParamToCanonical(String variant, String canonical)
   at Microsoft.TemplateEngine.Cli.ExtendedCommandParser.SetupTemplateParameters(IParameterSet allParams, IReadOnlyDictionary`2 longNameOverrides, IReadOnlyDictionary`2 shortNameOverrides)
   at Microsoft.TemplateEngine.Cli.New3Command.ParseTemplateArgs(ITemplateInfo templateInfo)
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterSingularTemplateManipulationFlowAsync>d__64.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterTemplateManipulationFlowAsync>d__65.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.TemplateEngine.Cli.New3Command.<ExecuteAsync>d__66.MoveNext()

Is there any way I can installed and use these SPA templates in SDK 1.0.4?

SteveSandersonMS commented 7 years ago

Sorry, that's not supported. They rely on both runtime and tooling features that are only present in the 2.0 libraries/SDK.