Installing Additional App Templates for dotnet new

Date Published: 28 June 2017

Installing Additional App Templates for dotnet new

When you install the.NET Core SDK, you get the dotnet CLI (command line interface), which can be used for ahostofdifferentthings, including creating new projects. You can see which templates are already installed by running

dotnet new -h

By default the SDK installs about 8 templates, with support for C# and F# (and blank solution files). However, there are quite a few additional templates available, and installing them is just a matter of running a simple dotnet command, too. For example, to install the ASP.NET Core SPA templates, run

dotnet new -i Microsoft.AspNetCore.SpaTemplates::*

This will install a few things…

When it’s done, it will list your new set of available templates:

The new package installs six new templates, covering Angular, Aurelia, Knockout, React, React/Redux, and Vue. But that isn’t the only template pack you can add. There are also templates available for ASP.NET MVC Boilerplate, NancyFX, NUnit 3, PowerShell, ServiceStack, and even templates for creating new templates. You can find all of these and more on the dotnet templating wiki (on GitHub), and if you create your own, you can add them there as well.

You can see how to use the Aurelia templates that are installed in this Channel 9 video by Rob Eisenberg on Getting Started with Aurelia and ASP.NET Core.

Steve Smith

About Ardalis

Software Engineer

Steve is an experienced software architect and trainer, focusing currently on ASP.NET Core and Domain-Driven Design.

Ardalis

Copyright © 2020