Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display the installed dotnet new template version numbers

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      ║
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
like image 672
BozoJoe Avatar asked Apr 11 '18 04:04

BozoJoe


People also ask

Where are dotnet templates installed?

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.

How do I create a new dotnet template?

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.

What is dotnet new Webapi?

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.)

What is dotnet command line?

The . NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing . NET applications.


1 Answers

There are two ways to get template version.

First, you can use the documented command

dotnet new -u

enter image description here

Second, you can use the following command:

dotnet new --debug:showconfig

which will show you all installed templates with their version number.

enter image description here

like image 66
nemke Avatar answered Nov 08 '22 18:11

nemke