oracle.net sdk,删除 .NET 运行时和 SDK | Microsoft Docs-程序员宅基地

技术标签: oracle.net sdk  

如何删除 .NET 运行时和 SDKHow to remove the .NET Runtime and SDK

03/02/2021

本文内容

经过一段时间后,在安装 .NET 运行时和 SDK 的更新版本时,你可能需要从计算机中删除过时的 .NET 版本。Over time, as you install updated versions of the .NET runtime and SDK, you may want to remove outdated versions of .NET from your machine. 如 .NET 版本选择一文中详述,删除旧版运行时可能会更改为运行共享框架应用程序所选择的运行时。Removing older versions of the runtime may change the runtime chosen to run shared framework applications, as detailed in the article on .NET version selection.

是否应删除某个版本?Should I remove a version?

借助 .NET 版本选择行为和 .NET 各个更新之间的运行时兼容性,可安全地删除以前的版本。The .NET version selection behaviors and the runtime compatibility of .NET across updates enables safe removal of previous versions. .NET 运行时更新在主版本“区段”(如 1.x 和 2.x)中兼容。.NET runtime updates are compatible within a major version band such as 1.x and 2.x. 此外,较新版本的 .NET SDK 通常能够兼容地生成面向运行时早期版本的应用程序。Additionally, newer releases of the .NET SDK generally maintain the ability to build applications that target previous versions of the runtime in a compatible manner.

通常,只需要应用程序所需的最新 SDK 和运行时的最新补丁版本。In general, you only need the latest SDK and latest patch version of the runtimes required for your application. 需要保留旧版 SDK 或运行时版本的实例包括维护基于 project.json 的应用程序 。Instances where you might want to keep older SDK or runtime versions include maintaining project.json-based applications. 除非应用程序有需保留早期 SDK 或运行时的特定原因,否则可以安全地删除旧版本。Unless your application has specific reasons for earlier SDKs or runtimes, you may safely remove older versions.

确定安装内容Determine what is installed

.NET CLI 提供了相关的选项,你可以使用它们来列出计算机上安装的 SDK 和运行时。The .NET CLI has options you can use to list the versions of the SDK and runtime that are installed on your machine. 使用 dotnet --list-sdks 查看计算机上安装的 SDK 列表。Use dotnet --list-sdks to see the list of SDKs installed on your machine. Use dotnet --list-runtimes to see the list of runtimes installed on your machine.

卸载 .NETUninstall .NET

.NET 使用 Windows“应用和功能”对话框来删除各版 .NET 运行时和 SDK。.NET uses the Windows Apps & features dialog to remove versions of the .NET runtime and SDK. 下图显示了“应用和功能”对话框 。The following figure shows the Apps & features dialog. 你可以搜索 core sdk 或 .net sdk 来筛选和显示安装的 .NET 版本 。You can search for core sdk or .net sdk to filter and show installed versions of .NET.

367f4da121c99e5e75a6e6fde8d98a04.png

选择要从计算机中删除的任何版本,然后单击“卸载” 。Select any versions you want to remove from your machine and click Uninstall.

Linux 还提供其他选项来卸载 .NET(SDK 或运行时)。There are more options to uninstall .NET (either SDK or runtime) on Linux. 卸载 .NET 的最佳方法是镜像用来安装 .NET 的操作。The best way for you to uninstall .NET is to mirror the action you used to install .NET. 具体取决于所选择的分发和安装方法。The specifics depend on your chosen distribution and the installation method.

重要

For Red Hat installations, consult the Red Hat Product Documentation for .NET.

除非从预览版本进行升级,否则使用包管理器升级时无需卸载 .NET SDK。There's no need to uninstall the .NET SDK when upgrading it using a package manager, unless you're upgrading from a preview version. 包管理器 update 或 refresh 命令将在成功安装较新版本后自动删除旧版本。The package manager update or refresh commands will automatically remove the older version upon the successful installation of a newer version. 如果已安装预览版本,请卸载该版本。If you have a preview version installed, uninstall it.

如果使用包管理器安装 .NET,则使用同一包管理器来卸载 .NET SDK 或运行时。If you installed .NET using a package manager, use that same package manager to uninstall the .NET SDK or runtime. .NET 安装支持常用的包管理器。.NET installations support most popular package managers. 有关环境中的精确语法,请查阅分发的包管理器文档:Consult the documentation for your distribution's package manager for the precise syntax in your environment:

apt-get(8) 由基于 Debian 的系统(包括 Ubuntu)使用。apt-get(8) is used by Debian based systems, including Ubuntu.

yum(8) 用于 Fedora、CentOS 和 Oracle Linux。yum(8) is used on Fedora, CentOS, and Oracle Linux.

zypper(8) 用于 openSUSE 和 SUSE Linux Enterprise System (SLES)。zypper(8) is used on openSUSE and SUSE Linux Enterprise System (SLES).

dnf(8) 用于 Fedora。dnf(8) is used on Fedora.

几乎在所有情况下,删除包的命令都是 remove。In almost all cases, the command to remove a package is remove.

大多数包管理器的 .NET SDK 安装包名称为 dotnet-sdk,后跟版本号。The package name for the .NET SDK installation for most package managers is dotnet-sdk, followed by the version number. 从 2.1.300 版 .NET SDK 和 2.1 版运行时开始,只需要主版本号和次版本号:例如,可将 .NET SDK 2.1.300 版引用为包 dotnet-sdk-2.1。Starting with the version 2.1.300 of the .NET SDK and version 2.1 of the runtime, only the major and minor version numbers are necessary: for example, the .NET SDK version 2.1.300 can be referenced as the package dotnet-sdk-2.1. 以前的版本则需要整个版本字符串:例如,2.1.200 版 .NET SDK 需要 dotnet-sdk-2.1.200。Prior versions require the entire version string: for example, dotnet-sdk-2.1.200 would be required for version 2.1.200 of the .NET SDK.

对于仅安装了运行时而未安装 SDK 的计算机,.NET 运行时的包名称为 dotnet-runtime-,整个运行时堆栈的包名称为 aspnetcore-runtime-。For machines that have installed only the runtime, and not the SDK, the package name is dotnet-runtime- for the .NET runtime, and aspnetcore-runtime- for the entire runtime stack.

提示

使用包管理器卸载 SDK 时,2.0 之前的 .NET Core 安装不会卸载主机应用程序。.NET Core installations earlier than 2.0 didn't uninstall the host application when the SDK was uninstalled using the package manager. 使用 apt-get,该命令为:Using apt-get, the command is:

apt-get remove dotnet-host

没有版本附加到 dotnet-host。There's no version attached to dotnet-host.

如果使用 tarball 安装,则必须手动删除 .NET。If you installed using a tarball, you must remove .NET using the manual method.

在 Linux 上,必须通过删除进行版本控制的目录,分别删除 SDK 和运行时。On Linux, you must remove the SDKs and runtimes separately, by removing the versioned directories. 这些目录可能因你的 Linux 分发版而异。These directories may vary depending on your Linux distribution. 删除它们会从磁盘中删除 SDK 和运行时。Removing them deletes the SDK and runtime from disk. 例如,要删除 1.0.1 SDK 和运行时,可使用以下 bash 命令:For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:

version="1.0.1"

sudo rm -rf /usr/share/dotnet/sdk/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.NETCore.App/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.All/$version

sudo rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.App/$version

sudo rm -rf /usr/share/dotnet/host/fxr/$version

SDK 和运行时的父目录列在 dotnet --list-sdks 和 dotnet --list-runtimes 命令的输出中,如上表所示。The parent directories for the SDK and runtime are listed in the output from the dotnet --list-sdks and dotnet --list-runtimes command, as shown in the earlier table.

在 Mac 上,必须通过删除进行版本控制的目录,分别删除 SDK 和运行时。On Mac, you must remove the SDKs and runtimes separately, by removing the versioned directories. 删除它们会从磁盘中删除 SDK 和运行时。Removing them deletes the SDK and runtime from disk. 例如,要删除 1.0.1 SDK 和运行时,可使用以下 bash 命令:For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:

version="1.0.1"

sudo rm -rf /usr/local/share/dotnet/sdk/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.NETCore.App/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.All/$version

sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/$version

sudo rm -rf /usr/local/share/dotnet/host/fxr/$version

SDK 和运行时的父目录列在 dotnet --list-sdks 和 dotnet --list-runtimes 命令的输出中,如上表所示。The parent directories for the SDK and runtime are listed in the output from the dotnet --list-sdks and dotnet --list-runtimes command, as shown in the earlier table.

.NET 卸载工具.NET Uninstall Tool

你可以使用 .NET 卸载工具 (dotnet-core-uninstall) 从系统中删除 .NET SDK 和运行时。The .NET Uninstall Tool (dotnet-core-uninstall) lets you remove .NET SDKs and runtimes from a system. 可使用选项集合来指定应卸载的版本。A collection of options is available to specify which versions should be uninstalled.

.NET Core SDK 版本的 Visual Studio 依赖项Visual Studio dependency on .NET Core SDK versions

在 Visual Studio 2019 版本 16.3 之前,Visual Studio 安装程序称为独立的 .NET Core SDK 安装程序。Before Visual Studio 2019 version 16.3, Visual Studio installers called the standalone .NET Core SDK installer. 因此,SDK 版本显示在 Windows“应用和功能”对话框中 。As a result, the SDK versions appear in the Windows Apps & features dialog. 使用独立安装程序删除 Visual Studio 安装的 .NET Core SDK 可能会破坏 Visual Studio。Removing .NET Core SDKs that were installed by Visual Studio using the standalone installer may break Visual Studio. 如果 Visual Studio 在卸载 SDK 之后出现问题,请在该特定版本的 Visual Studio 上运行修复。If Visual Studio has problems after you uninstall SDKs, run Repair on that specific version of Visual Studio. 下表显示了 .NET Core SDK 版本的一些 Visual Studio 依赖项:The following table shows some of the Visual Studio dependencies on .NET Core SDK versions:

Visual Studio 版本Visual Studio version

.NET Core SDK 版本.NET Core SDK version

Visual Studio 2019 版本 16.2Visual Studio 2019 version 16.2

.NET Core SDK 2.2.4xx、2.1.8xx.NET Core SDK 2.2.4xx, 2.1.8xx

Visual Studio 2019 版本 16.1Visual Studio 2019 version 16.1

.NET Core SDK 2.2.3xx、2.1.7xx.NET Core SDK 2.2.3xx, 2.1.7xx

Visual Studio 2019 版本 16.0Visual Studio 2019 version 16.0

.NET Core SDK 2.2.2xx、2.1.6xx.NET Core SDK 2.2.2xx, 2.1.6xx

Visual Studio 2017 版本 15.9Visual Studio 2017 version 15.9

.NET Core SDK 2.2.1xx、2.1.5xx.NET Core SDK 2.2.1xx, 2.1.5xx

Visual Studio 2017 版本 15.8Visual Studio 2017 version 15.8

.NET Core SDK 2.1.4xx.NET Core SDK 2.1.4xx

从 Visual Studio 2019 16.3 版开始,Visual Studio 负责其自己的 .NET SDK 副本。Starting with Visual Studio 2019 version 16.3, Visual Studio is in charge of its own copy of the .NET SDK. 因此,“应用和功能”对话框中将不再显示这些 SDK 版本 。For that reason, you no longer see those SDK versions in the Apps & features dialog.

删除 NuGet 回退文件夹Remove the NuGet fallback folder

在 .NET Core 3.0 SDK 之前,.NET Core SDK 安装程序使用名为 NuGetFallbackFolder 的文件夹存储 NuGet 包的缓存 。Before .NET Core 3.0 SDK, the .NET Core SDK installers used a folder named NuGetFallbackFolder to store a cache of NuGet packages. 此缓存在操作期间(如 dotnet restore 或 dotnet build /t:Restore)使用。This cache was used during operations such as dotnet restore or dotnet build /t:Restore. NuGetFallbackFolder 在 Windows 上位于 C:\Program Files\dotnet\sdk,在 macOS 上位于 /usr/local/share/dotnet/sdk 。The NuGetFallbackFolder is located at C:\Program Files\dotnet\sdk on Windows and at /usr/local/share/dotnet/sdk on macOS.

如果是以下情况,则可能需要删除此文件夹:You may want to remove this folder, if:

仅使用 .NET Core 3.0 SDK 或 .NET 5.0(或更高版本)进行开发。You're only developing using .NET Core 3.0 SDK or .NET 5.0 or later versions.

你使用早于 3.0 的 .NET Core SDK 版本进行开发,但可以联机工作。You're developing using .NET Core SDK versions earlier than 3.0, but you can work online.

如果要删除 NuGet 回退文件夹,可以将其删除,但需要管理员权限才能执行此操作。If you want to remove the NuGet fallback folder, you can delete it, but you'll need admin privileges to do so.

建议不要删除 dotnet 文件夹。It's not recommended to delete the dotnet folder. 这样做会删除以前安装的所有全局工具。Doing so would remove any global tools you've previously installed. 此外,在 Windows 上:Also, on Windows:

你将中断 Visual Studio 2019 版本 16.3 及更高版本。You'll break Visual Studio 2019 version 16.3 and later versions. 可以运行“修复” 来恢复。You can run Repair to recover.

如果“应用和功能”对话框中存在 .NET Core SDK 条目,它们将是孤立的 。If there are .NET Core SDK entries in the Apps & features dialog, they'll be orphaned.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42514222/article/details/116383259

智能推荐

攻防世界_难度8_happy_puzzle_攻防世界困难模式攻略图文-程序员宅基地

文章浏览阅读645次。这个肯定是末尾的IDAT了,因为IDAT必须要满了才会开始一下个IDAT,这个明显就是末尾的IDAT了。,对应下面的create_head()代码。,对应下面的create_tail()代码。不要考虑爆破,我已经试了一下,太多情况了。题目来源:UNCTF。_攻防世界困难模式攻略图文

达梦数据库的导出(备份)、导入_达梦数据库导入导出-程序员宅基地

文章浏览阅读2.9k次,点赞3次,收藏10次。偶尔会用到,记录、分享。1. 数据库导出1.1 切换到dmdba用户su - dmdba1.2 进入达梦数据库安装路径的bin目录,执行导库操作  导出语句:./dexp cwy_init/[email protected]:5236 file=cwy_init.dmp log=cwy_init_exp.log 注释:   cwy_init/init_123..._达梦数据库导入导出

js引入kindeditor富文本编辑器的使用_kindeditor.js-程序员宅基地

文章浏览阅读1.9k次。1. 在官网上下载KindEditor文件,可以删掉不需要要到的jsp,asp,asp.net和php文件夹。接着把文件夹放到项目文件目录下。2. 修改html文件,在页面引入js文件:<script type="text/javascript" src="./kindeditor/kindeditor-all.js"></script><script type="text/javascript" src="./kindeditor/lang/zh-CN.js"_kindeditor.js

STM32学习过程记录11——基于STM32G431CBU6硬件SPI+DMA的高效WS2812B控制方法-程序员宅基地

文章浏览阅读2.3k次,点赞6次,收藏14次。SPI的详情简介不必赘述。假设我们通过SPI发送0xAA,我们的数据线就会变为10101010,通过修改不同的内容,即可修改SPI中0和1的持续时间。比如0xF0即为前半周期为高电平,后半周期为低电平的状态。在SPI的通信模式中,CPHA配置会影响该实验,下图展示了不同采样位置的SPI时序图[1]。CPOL = 0,CPHA = 1:CLK空闲状态 = 低电平,数据在下降沿采样,并在上升沿移出CPOL = 0,CPHA = 0:CLK空闲状态 = 低电平,数据在上升沿采样,并在下降沿移出。_stm32g431cbu6

计算机网络-数据链路层_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输-程序员宅基地

文章浏览阅读1.2k次,点赞2次,收藏8次。数据链路层习题自测问题1.数据链路(即逻辑链路)与链路(即物理链路)有何区别?“电路接通了”与”数据链路接通了”的区别何在?2.数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点。3.网络适配器的作用是什么?网络适配器工作在哪一层?4.数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?5.如果在数据链路层不进行帧定界,会发生什么问题?6.PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输

软件测试工程师移民加拿大_无证移民,未受过软件工程师的教育(第1部分)-程序员宅基地

文章浏览阅读587次。软件测试工程师移民加拿大 无证移民,未受过软件工程师的教育(第1部分) (Undocumented Immigrant With No Education to Software Engineer(Part 1))Before I start, I want you to please bear with me on the way I write, I have very little gen...

随便推点

Thinkpad X250 secure boot failed 启动失败问题解决_安装完系统提示secureboot failure-程序员宅基地

文章浏览阅读304次。Thinkpad X250笔记本电脑,装的是FreeBSD,进入BIOS修改虚拟化配置(其后可能是误设置了安全开机),保存退出后系统无法启动,显示:secure boot failed ,把自己惊出一身冷汗,因为这台笔记本刚好还没开始做备份.....根据错误提示,到bios里面去找相关配置,在Security里面找到了Secure Boot选项,发现果然被设置为Enabled,将其修改为Disabled ,再开机,终于正常启动了。_安装完系统提示secureboot failure

C++如何做字符串分割(5种方法)_c++ 字符串分割-程序员宅基地

文章浏览阅读10w+次,点赞93次,收藏352次。1、用strtok函数进行字符串分割原型: char *strtok(char *str, const char *delim);功能:分解字符串为一组字符串。参数说明:str为要分解的字符串,delim为分隔符字符串。返回值:从str开头开始的一个个被分割的串。当没有被分割的串时则返回NULL。其它:strtok函数线程不安全,可以使用strtok_r替代。示例://借助strtok实现split#include <string.h>#include <stdio.h&_c++ 字符串分割

2013第四届蓝桥杯 C/C++本科A组 真题答案解析_2013年第四届c a组蓝桥杯省赛真题解答-程序员宅基地

文章浏览阅读2.3k次。1 .高斯日记 大数学家高斯有个好习惯:无论如何都要记日记。他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢?高斯出生于:1777年4月30日。在高斯发现的一个重要定理的日记_2013年第四届c a组蓝桥杯省赛真题解答

基于供需算法优化的核极限学习机(KELM)分类算法-程序员宅基地

文章浏览阅读851次,点赞17次,收藏22次。摘要:本文利用供需算法对核极限学习机(KELM)进行优化,并用于分类。

metasploitable2渗透测试_metasploitable2怎么进入-程序员宅基地

文章浏览阅读1.1k次。一、系统弱密码登录1、在kali上执行命令行telnet 192.168.26.1292、Login和password都输入msfadmin3、登录成功,进入系统4、测试如下:二、MySQL弱密码登录:1、在kali上执行mysql –h 192.168.26.129 –u root2、登录成功,进入MySQL系统3、测试效果:三、PostgreSQL弱密码登录1、在Kali上执行psql -h 192.168.26.129 –U post..._metasploitable2怎么进入

Python学习之路:从入门到精通的指南_python人工智能开发从入门到精通pdf-程序员宅基地

文章浏览阅读257次。本文将为初学者提供Python学习的详细指南,从Python的历史、基础语法和数据类型到面向对象编程、模块和库的使用。通过本文,您将能够掌握Python编程的核心概念,为今后的编程学习和实践打下坚实基础。_python人工智能开发从入门到精通pdf