如何删除 Windows 上的 dotnet 运行时? [英] How to remove a dotnet runtime on Windows?
问题描述
我找到了命令 dotnet --list-runtimes
并且它为我输出(缩写):
I've found the command dotnet --list-runtimes
and it outputs (abbreviated) for me:
Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
我想删除特定的 AspNetCore.App 运行时,看看它是否能帮助我解决另一个不同的问题 - 但我不知道怎么做.
I want to remove specific AspNetCore.App runtimes to see if it helps me solve another, different issue - but I don't know how.
我试过了:
- 使用添加/删除程序,但它只列出了.NET Core SDK"条目,而不是运行时(另外:这个列表缺少几个在
dotnet --list-runtimes
输出) - 浏览可用的
dotnet help
条目,但没有看到相关选项 - 浏览
remove-runtime-sdk-version
readme 但它告诉我使用添加/删除程序,这对我没有帮助
- Using Add/Remove Programs, but it only lists ".NET Core SDK" entries, not runtimes (also: this list is missing several versions that were in the
dotnet --list-runtimes
output) - Going through the available
dotnet help
entries, but saw no relevant option - Go through the
remove-runtime-sdk-version
readme but it tells me to use Add/Remove Programs, which doesn't help me
我已经考虑删除我的输出中提到的文件夹,但我对开始删除 Program Files
子文件夹中的文件夹犹豫不决.
I've considered removing the folders mentioned in my output, but am hesitant to just start deleting folders in Program Files
subfolders.
是否有 dotnet
命令或其他删除运行时的好方法,特别是 AspNetCore 版本,以便我可以 100% 确定 ASP.NET Core 的版本选择"功能无法选择版本不对?
Is there a dotnet
command or other good way to remove runtimes, specifically AspNetCore versions, so that I can be 100% sure that the "Version Selection" feature from ASP.NET Core cannot pick up a wrong version?
根据评论,我尝试了 dotnet-core-uninstall
工具(预览版),但如果我运行 dotnet-core-uninstall
,它会列出零运行时间它可以卸载,只能卸载 SDK(并且只有 2.x 版本).
Per the comments, I've tried the dotnet-core-uninstall
tool (preview release), but if I run dotnet-core-uninstall
it lists zero runtimes it could uninstall, only SDKs (and only 2.x versions at that).
推荐答案
现在有 官方推荐的卸载 .net 运行时和 sdk 的方法.它的要点是:
There now is a officially recommended method to uninstall .net runtime and sdk. The gist of it is:
- 安装.NET 卸载工具"
- 使用
dotnet-core-uninstall
及其各种命令(list
、dry-run
和remove
)
- Install the ".NET Uninstall Tool"
- Use
dotnet-core-uninstall
with its various commands (list
,dry-run
, andremove
)
小心使用!
这篇关于如何删除 Windows 上的 dotnet 运行时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!