.net core 无法通过文件夹模板卸载“dotnet new”?

.net core 无法通过文件夹模板卸载“dotnet new”?,.net-core,.net Core,是否有一种特殊的方法来卸载文件夹模板dotnet new项目 这将成功地将模板放置到位,以便与dotnet new{shortName}一起使用 The template "Some Template Name" was created successfully. 遗憾的是,我无法在以后使用相应的命令()卸载该模板 而是产生以下输出 Could not find something to uninstall called '.\some-template-folder\'. 细节 如果有帮助

是否有一种特殊的方法来卸载文件夹模板
dotnet new
项目

这将成功地将模板放置到位,以便与
dotnet new{shortName}
一起使用

The template "Some Template Name" was created successfully.
遗憾的是,我无法在以后使用相应的命令()卸载该模板

而是产生以下输出

Could not find something to uninstall called '.\some-template-folder\'.
细节 如果有帮助,下面是文件夹的.template.config子文件夹中包含的文件夹的最小template.json文件

{
“$schema”:”http://json.schemastore.org/template",
“作者”:“某个作者”,
“分类”:[“一些”、“各种”、“搜索关键字”],
“身份”:“Some.identity”,
“shortName”:“dotnetnew中使用的名称”,
“名称”:“某些模板名称”
}
锉虫

这是我的机器特定模板状态的问题。在执行
dotnet new--debug:reinit
将模板恢复到新安装的状态后,问题就消失了

潜在问题 虽然我的问题是特定于机器的,但通过
dotnet new--uninstall
路径卸载的某些元素也可能导致此问题

使路径绝对化 虽然可以从相对路径(例如,
dotnet new--install./some template
)进行安装,但必须从完全限定的路径进行卸载

dotnet new --uninstall C:\full\path\to\some-template
避免终端斜杠 此外,当您将完全限定路径传递到
--uninstall
时,不要包含命令行环境在完成路径时可能自动包含的终端斜杠

dotnet new --uninstall C:\full\path\to\some-template #<-- no terminal \ here
它将输出这样一个列表,其中包含NuGet包的短名称和本地安装模板的完整路径

Template Instantiation Commands for .NET Core CLI

Currently installed items:
 Microsoft.DotNet.Common.ItemTemplates
 ...
 dotnet-new-project-helper
 C:\full\path\to\some-template
然后可以使用列出的路径卸载最终模板

dotnet new--卸载C:\full\path\to\some模板
dotnet new --uninstall C:\full\path\to\some-template
dotnet new --uninstall C:\full\path\to\some-template #<-- no terminal \ here
Template Instantiation Commands for .NET Core CLI

Currently installed items:
 Microsoft.DotNet.Common.ItemTemplates
 ...
 dotnet-new-project-helper
 C:\full\path\to\some-template