如何显示已安装的dotnet新模板版本号

时间:2018-04-11 04:25:28

标签: templates .net-core

我安装了一系列用于

的dotnet模板
dotnet new

使用cli选项,例如

dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0

dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates::*

如此处所述Available-templates-for-dotnet-new

如何列出我安装的模板版本?

的输出
dotnet new

不显示模板的当前版本

╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║        Templates                                                 Short Name       Language          Tags         ║
╠══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║ ---------------------------------------------------------------------------------------------------------------- ║
║ Console Application                                       console          [C#], F#, VB      Common/Console      ║
║ Class library                                             classlib         [C#], F#, VB      Common/Library      ║
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

2 个答案:

答案 0 :(得分:5)

我认为最好的是查看

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

其中包含文件名中的版本号的nupkgs(以及nupkg拉链)

答案 1 :(得分:2)

有两种获取模板版本的方法。

拳头,您可以使用已记录的command

dotnet new -u

enter image description here

第二,您可以使用以下命令:

dotnet new --debug:showconfig

它将显示所有已安装的模板及其版本号。

enter image description here

相关问题