BozoJoe
BozoJoe

Reputation: 6462

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      ║
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

Upvotes: 19

Views: 6886

Answers (2)

nemke
nemke

Reputation: 2468

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

Upvotes: 23

BozoJoe
BozoJoe

Reputation: 6462

[update - note that this post is now over 2 years old, and the tooling appears to have gotten much better] The best I seem to come up with is to look in

C:\Users\BozoJoe\.templateengine\dotnetcli\v2.1.104\packages

which has the nupkgs with the version numbers in the file names (as well as the nupkg zips)

Upvotes: 9

Related Questions