32

I have the following versions of .NET Core SDKs installed on my machine:

enter image description here enter image description here

Please confirm that I understand what each of these is (and if I can uninstall them):

.NET Core SDK 1.0.0 (x64) Installer (x64): This was installed along with VS2017

.NET Core SDK 1.0.1 (x64): Downloaded somewhere here and installed manually. Exactly the same as the 1.0.0 SDK above except that it includes support for Fedora 24 and OpenSUSE 42.1. So as a Windows user, can I uninstall this?

The other four Microsoft .NET Core 1.x.x SDKs are various versions of the VS2015 (and project.json) preview tooling and can thus be uninstalled?

Dave New
  • 38,496
  • 59
  • 215
  • 394

4 Answers4

22

First of all, this is the page I find the most useful to understand the complicated versioning of .NET CORE: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md

Then, something that you might already know but that was unclear to me at some point: there is a different versioning between runtimes and SDK and it's sometime complicated to follow. When you install some SDKs it's coming with associated runtimes, for instance .NET CORE SDK 1.0.1 comes with the runtime FTS 1.1.1 and LTS 1.0.4 ... to see that, the creation date of folders installed here can be informative: 'C:\Program Files\dotnet\sdk' for the SDK and 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App' for the runtimes.

So, let me tell you what I think of your statement.

.NET Core SDK 1.0.0 (x64) Installer (x64): This was installed along with VS2017

Agreed. It corresponds to the ".NET Core SDK 1.0.0 and 1.0.1" part of https://github.com/dotnet/core/blob/master/release-notes/1.0/1.0.4.md.

.NET Core SDK 1.0.1 (x64): Downloaded somewhere here and installed manually. Exactly the same as the 1.0.0 SDK above except that it includes support for Fedora 24 and OpenSUSE 42.1. So as a Windows user, can I uninstall this?

Agreed, as stated on the same link as above. My concern is that if you uninstall that you might end up uninstalling the associated runtimes: FTS 1.1.1 and LTS 1.0.4. On my machine, those have been installed at the same date as this SDK and haven't been reinstalled with VS2017 so I'm not sure how the uninstaller would behave.

The other four Microsoft .NET Core 1.x.x SDKs are various versions of the VS2015 (and project.json) preview tooling and can thus be uninstalled?

Visual Studio 2015 is compatible with all SDKs up to preview 2.X based on project.json, preview 3 and upward removed the .json support and moved to .csproj, only compatible with Visual 2017. So if you are only using VS2017 and the latest runtimes 1.0.4/1.1.1 you can safely removed all those. Just make sure that your project is not targeting a particular runtime that you would be removing doing so, see the frameworks of https://learn.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj

A generic comment: .NET CORE is supposed to be portable, so its deployement is supposed to be very easy, you don't really have to install it, just copy the proper folder and then set the right env variables and it should be working, it is not deeply modofying your env (no registry entries, no registration of tons of components ...) so you should be able to install / uninstall and test it quite safely. At least, that's my understanding of what MS is trying to do.

patridge
  • 26,385
  • 18
  • 89
  • 135
Daboul
  • 2,635
  • 1
  • 16
  • 29
  • 1
    Thanks! It took me a while to understand that, but it's very important when it comes to deploy the software in production on a server. – Daboul Apr 05 '17 at 11:57
3

4 linux fellows

>> dotnet --list-sdks 

2.1.402 [/usr/share/dotnet/sdk]
2.2.105 [/usr/share/dotnet/sdk]
3.0.101 [/usr/share/dotnet/sdk]


>> sudo apt-get purge  dotnet-sdk-3.0    

Hope that helps

bereket gebredingle
  • 12,064
  • 3
  • 36
  • 47
2

The following commands help you understand what is installed on your machine:

dotnet --info
dotnet --list-sdks

Generally, it is not sufficient to just keep the latest SDK available to download. At the time of writing, this would be 3.1 LTS for me, but we have some netcoreapp2.1 applications and a 2.1 SDK is needed to build those. Once you identified all major.minor combinations you need to build for (in my case 3.1 and 2.1) the next step is to identify the latest compatible version for your build environment.

If you use Visual Studio, take a look at the following web site to compare compatible (not latest!) versions: https://dotnet.microsoft.com/download/visual-studio-sdks . This page lists the sdk versions (not runtime versions) that work with Visual Studio. EOL (end of life) tags help you undestand what versions to avoid (uninstall, unless you build those). You will notice that the Visual Studio Installer keeps installing some old versions (eventually becasue I selected some dotnet core workload?) - not sure how to avoid that.

All available runtime versions are listed here: https://dotnet.microsoft.com/download/dotnet-core , but once you select a particular major.minor combo, more details including sdk versions are shown.

Patrick Stalph
  • 792
  • 1
  • 9
  • 19
2

For Windows and macOS, there is now the .NET Uninstall Tool created by Microsoft for .NET Core / .NET 5.x and later:

https://learn.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool

It is particularly useful on macOS, as uninstalling .NET Core SDKs and runtimes previously required the manual removal of several installation folders per version. But it may also be helpful for Windows users who have many unused versions installed, as it automates the removal of all outdated versions in a single operation.

The following command will list installed .NET Core SDKs and runtimes, with the ones that are in use by Visual Studio explicitly marked as such:

dotnet-core-uninstall list

Running the tool with the --all switch will remove all versions except the ones that are in use. There is a dry-run mode to verify what will be removed without making any changes. SDKs and runtimes must be removed in separate invokations of the tool. Dry-run example for SDKs:

dotnet-core-uninstall dry-run --all --sdk

Dry-run example for runtimes:

dotnet-core-uninstall dry-run --all --runtime

To perform the actual removal, change dry-run to remove, and run the command with elevated access (Windows) or sudo (macOS).

Otto G
  • 670
  • 7
  • 14