macOS卸载.net core 8.0

发布于:2025-08-02 ⋅ 阅读:(10) ⋅ 点赞:(0)

title: macOS卸载.net core 8.0
date: 2024-08-07 00:27:50
tags: 解决办法


用官方的卸载工具:

说明页面

https://learn.microsoft.com/zh-cn/dotnet/core/additional-tools/uninstall-tool?tabs=macos

源代码页面

https://github.com/dotnet/cli-lab

下载页面

https://github.com/dotnet/cli-lab/releases/tag/1.7.521001

下载dotnet-core-uninstall.tar并解压缩到文件夹中,比如temp

打开终端,导航到该文件夹

执行:

./dotnet-core-uninstall -h查看该工具所有命令

./dotnet-core-uninstall list查看安装的所有.net版本

输出:

xxx@MacBook-Pro temp % ./dotnet-core-uninstall list

This tool cannot uninstall versions of the runtime or SDK that are installed using zip/scripts. The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  8.0.202  (arm64)  [Used by Visual Studio for Mac. Specify individually or use —-force to remove]

.NET Core Runtimes:
  8.0.3  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]

然后执行

./dotnet-core-uninstall dry-run 8.0.3 --runtime

./dotnet-core-uninstall dry-run 8.0.202 --sdk

进行试运行,版本号要和list输出的一致

提示可以删除的话,执行以下删除命令,版本号依旧要一致:

前面加sudo获取最大权限

sudo ./dotnet-core-uninstall remove 8.0.202 --sdk

sudo ./dotnet-core-uninstall remove 8.0.3 --runtime