I have installed a series of dotnet templates for use with
dotnet new
by using cli options such as
dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0
or
dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates::*
as described here Available-templates-for-dotnet-new
How do I list what versions of templates I have installed? the output of
dotnet new
doesn't display the current version of the template
╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Templates Short Name Language Tags ║
╠══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║ ---------------------------------------------------------------------------------------------------------------- ║
║ Console Application console [C#], F#, VB Common/Console ║
║ Class library classlib [C#], F#, VB Common/Library ║
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
Templates are installed through the dotnet new SDK command with the -i parameter. You can either provide the NuGet package identifier of a template, or a folder that contains the template files.
In your terminal, navigate to the working\templates folder and create a new subfolder named consoleasync. Enter the subfolder and run dotnet new console to generate the standard console application. You'll be editing the files produced by this template to create a new template.
dotnet new is the command to create a new project in dotnet core. dotnet new webapi will create a webapi project. (NOTE: To know all the project types provided by dotnet new, type dotnet new --help. If no type is given to dotnet new command, it will create a console application project as default.)
The . NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing . NET applications.
There are two ways to get template version.
First, you can use the documented command
dotnet new -u
Second, you can use the following command:
dotnet new --debug:showconfig
which will show you all installed templates with their version number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With