Over time, as you install updated versions of the .NET Core runtime and SDK, you may want to remove outdated versions of .NET Core from your machine. Removing older versions of the runtime may change the runtime chosen to run shared framework applications, as detailed in the article on .NET Core version selection.
![]() -->
Patch 2.7 was released on 2017-03-07 with the checksum WHGQ.It was released alongside the Monks and Mystics expansion. Expansion features Societies. Join Societies to gain different bonuses and access to a wide set of various powers, each unique to the different types of Societies! Bug:1262 - 'manual. Running 2.4.22 ck2 kernel' status:RESOLVED resolution:WORKSFORME. Bug:90230 - 'sci-mathematics/pari-2.1.6 build fails: Undefined reference in. Status:RESOLVED resolution:WORKSFORME severity:normal Bug:106361 - 'Bind ebuild should have added a use flag for caps to disable linux.
Should I remove a version?
The .NET Core version selection behaviors and the runtime compatibility of .NET Core across updates enables safe removal of previous versions. .NET Core runtime updates are compatible within a major version 'band' such as 1.x and 2.x. Additionally, newer releases of the .NET Core SDK generally maintain the ability to build applications that target previous versions of the runtime in a compatible manner.
In general, you only need the latest SDK and latest patch version of the runtimes required for your application. Instances where keeping older SDK or Runtime versions include maintaining project.json-based applications. Unless your application has specific reasons for earlier SDKs or runtimes, you may safely remove older versions.
Determine what is installed
Starting with .NET Core 2.1, the .NET CLI has options you can use to list the versions of the SDK and runtime that are installed on your machine. 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. The following text shows typical output for Windows, macOS, or Linux:
Uninstalling .NET Core
.NET Core uses the Windows Add/Remove Programs dialog to remove versions of the .NET Core runtime and SDK. The following figure shows the Add/Remove Programs dialog with several versions of the .NET runtime and SDK installed.
Select any versions you want to remove from your machine and click Uninstall.
There are more options to uninstall .NET Core (either SDK or runtime) on Linux. The best way for you to uninstall .NET Core is to mirror the action you used to install .NET Core. The specifics depend on your chosen distribution and the installation method.
Important
For Red Hat installations, consult the Red Hat Getting Started Guide for information on installing and uninstalling .NET Core.
Starting with .NET Core 2.1, there's no need to uninstall the .NET Core SDK when upgrading it using a package manager. The package manager
update or refresh commands will automatically remove the older version upon the successful installation of a newer version.
If you installed .NET Core using a package manager, you use that same package manager to uninstall .NET SDK or runtime. .NET Core installations support most popular package managers. Consult the documentation for your distribution's package manager for the precise syntax on your environment:
In almost all cases, the command to remove a package is
remove .
The package name for the .NET Core SDK installation for most package managers is
dotnet-sdk , followed by the version number. Starting with the version 2.1.300 of the .NET Core SDK and version 2.1 of the runtime, only the major and minor version numbers are necessary: for example, the .NET Core SDK version 2.1.300 can be referenced as the package dotnet-sdk-2.1 . 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 Core SDK.
For machines that have installed only the runtime, and not the SDK, the package name is
dotnet-runtime-<version> for the .NET Core runtime, and aspnetcore-runtime-<version> for the entire runtime stack.
.NET Core installations earlier than 2.0 didn't uninstall the host application when the SDK was uninstalled using the package manager. Using
apt-get , the command is:
Note that there's no version attached to
dotnet-host .
If you installed using a tarball, you must remove .NET Core using the manual method.
You remove the SDKs and runtimes separately, by removing the directory that contains that version. For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:
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.
On Mac, you must remove the SDKs and runtimes separately, by removing the directory that contains that version. For example, to remove the 1.0.1 SDK and runtime, you would use the following bash commands:
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 Core Uninstall Tool![]()
The .NET Core Uninstall Tool (
dotnet-core-uninstall ) lets you remove .NET Core SDKs and Runtimes from a system. A collection of options is available to specify which versions should be uninstalled.
Visual Studio dependency on .NET Core SDK versions
Before Visual Studio 2019 version 16.3, Visual Studio installers called the standalone .NET Core SDK installer. As a result, the SDK versions appear in the Windows Add/Remove Programs dialog. Removing .NET Core SDKs that were installed by Visual Studio using the standalone installer may break Visual Studio. If Visual Studio has problems after you uninstall SDKs, run Repair on that specific version of Visual Studio. The following table shows some of the Visual Studio dependencies on .NET Core SDK versions:
Starting with Visual Studio 2019 16.3, Visual Studio is in charge of its own copy of the .NET Core SDK. For that reason, you no longer see those SDK versions in the Add/Remove Programs dialog.
Remove the NuGet fallback folder
Before .NET Core 3.0 SDK, the .NET Core SDK installers used the NuGetFallbackFolder to store a cache of NuGet packages. This cache was used during operations such as
dotnet restore or dotnet build /t:Restore . The NuGetFallbackFolder is located at C:Program Filesdotnetsdk on Windows and at /usr/local/share/dotnet/sdk on macOS.
You may want to remove this folder, if:
If you want to remove the NuGet fallback folder, you can delete it, but you'll need admin privileges to do so.
It's not recommended to delete the dotnet folder. Doing so would remove any global tools you've previously installed. Also, on Windows:
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |