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 Architect

Steve is an experienced software architect and trainer, focusing on code quality and Domain-Driven Design with .NET.