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

智能推荐

c# 调用c++ lib静态库_c#调用lib-程序员宅基地

文章浏览阅读2w次,点赞7次,收藏51次。四个步骤1.创建C++ Win32项目动态库dll 2.在Win32项目动态库中添加 外部依赖项 lib头文件和lib库3.导出C接口4.c#调用c++动态库开始你的表演...①创建一个空白的解决方案,在解决方案中添加 Visual C++ , Win32 项目空白解决方案的创建:添加Visual C++ , Win32 项目这......_c#调用lib

deepin/ubuntu安装苹方字体-程序员宅基地

文章浏览阅读4.6k次。苹方字体是苹果系统上的黑体,挺好看的。注重颜值的网站都会使用,例如知乎:font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, W..._ubuntu pingfang

html表单常见操作汇总_html表单的处理程序有那些-程序员宅基地

文章浏览阅读159次。表单表单概述表单标签表单域按钮控件demo表单标签表单标签基本语法结构<form action="处理数据程序的url地址“ method=”get|post“ name="表单名称”></form><!--action,当提交表单时,向何处发送表单中的数据,地址可以是相对地址也可以是绝对地址--><!--method将表单中的数据传送给服务器处理,get方式直接显示在url地址中,数据可以被缓存,且长度有限制;而post方式数据隐藏传输,_html表单的处理程序有那些

PHP设置谷歌验证器(Google Authenticator)实现操作二步验证_php otp 验证器-程序员宅基地

文章浏览阅读1.2k次。使用说明:开启Google的登陆二步验证(即Google Authenticator服务)后用户登陆时需要输入额外由手机客户端生成的一次性密码。实现Google Authenticator功能需要服务器端和客户端的支持。服务器端负责密钥的生成、验证一次性密码是否正确。客户端记录密钥后生成一次性密码。下载谷歌验证类库文件放到项目合适位置(我这边放在项目Vender下面)https://github.com/PHPGangsta/GoogleAuthenticatorPHP代码示例://引入谷_php otp 验证器

【Python】matplotlib.plot画图横坐标混乱及间隔处理_matplotlib更改横轴间距-程序员宅基地

文章浏览阅读4.3k次,点赞5次,收藏11次。matplotlib.plot画图横坐标混乱及间隔处理_matplotlib更改横轴间距

docker — 容器存储_docker 保存容器-程序员宅基地

文章浏览阅读2.2k次。①Storage driver 处理各镜像层及容器层的处理细节,实现了多层数据的堆叠,为用户 提供了多层数据合并后的统一视图②所有 Storage driver 都使用可堆叠图像层和写时复制(CoW)策略③docker info 命令可查看当系统上的 storage driver主要用于测试目的,不建议用于生成环境。_docker 保存容器

随便推点

网络拓扑结构_网络拓扑csdn-程序员宅基地

文章浏览阅读834次,点赞27次,收藏13次。网络拓扑结构是指计算机网络中各组件(如计算机、服务器、打印机、路由器、交换机等设备)及其连接线路在物理布局或逻辑构型上的排列形式。这种布局不仅描述了设备间的实际物理连接方式,也决定了数据在网络中流动的路径和方式。不同的网络拓扑结构影响着网络的性能、可靠性、可扩展性及管理维护的难易程度。_网络拓扑csdn

JS重写Date函数,兼容IOS系统_date.prototype 将所有 ios-程序员宅基地

文章浏览阅读1.8k次,点赞5次,收藏8次。IOS系统Date的坑要创建一个指定时间的new Date对象时,通常的做法是:new Date("2020-09-21 11:11:00")这行代码在 PC 端和安卓端都是正常的,而在 iOS 端则会提示 Invalid Date 无效日期。在IOS年月日中间的横岗许换成斜杠,也就是new Date("2020/09/21 11:11:00")通常为了兼容IOS的这个坑,需要做一些额外的特殊处理,笔者在开发的时候经常会忘了兼容IOS系统。所以就想试着重写Date函数,一劳永逸,避免每次ne_date.prototype 将所有 ios

如何将EXCEL表导入plsql数据库中-程序员宅基地

文章浏览阅读5.3k次。方法一:用PLSQL Developer工具。 1 在PLSQL Developer的sql window里输入select * from test for update; 2 按F8执行 3 打开锁, 再按一下加号. 鼠标点到第一列的列头,使全列成选中状态,然后粘贴,最后commit提交即可。(前提..._excel导入pl/sql

Git常用命令速查手册-程序员宅基地

文章浏览阅读83次。Git常用命令速查手册1、初始化仓库git init2、将文件添加到仓库git add 文件名 # 将工作区的某个文件添加到暂存区 git add -u # 添加所有被tracked文件中被修改或删除的文件信息到暂存区,不处理untracked的文件git add -A # 添加所有被tracked文件中被修改或删除的文件信息到暂存区,包括untracked的文件...

分享119个ASP.NET源码总有一个是你想要的_千博二手车源码v2023 build 1120-程序员宅基地

文章浏览阅读202次。分享119个ASP.NET源码总有一个是你想要的_千博二手车源码v2023 build 1120

【C++缺省函数】 空类默认产生的6个类成员函数_空类默认产生哪些类成员函数-程序员宅基地

文章浏览阅读1.8k次。版权声明:转载请注明出处 http://blog.csdn.net/irean_lau。目录(?)[+]1、缺省构造函数。2、缺省拷贝构造函数。3、 缺省析构函数。4、缺省赋值运算符。5、缺省取址运算符。6、 缺省取址运算符 const。[cpp] view plain copy_空类默认产生哪些类成员函数

推荐文章

热门文章

相关标签