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

Closed
opened 2025-08-09 17:16:02 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @sntnupl on 10/8/2017

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?

*Originally created by @sntnupl on 10/8/2017* 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: ```sh 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: ```sh 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?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#373
No description provided.