Unable to uninstall lower SDK patches
I need to remove all older .NET Core SDK patches.
Currently, I have the following SDKs installed dotnet-core-uninstall list --sdk
.NET Core SDKs:
5.0.403 x64 [Used by Visual Studio. Specify individually or use --force to remove]
5.0.303 x64
3.1.415 x64
3.1.120 x64
When launching the command dotnet-core-uninstall dry-run --all-lower-patches --sdk nothing is displayed.
The expected output should be:
*** DRY RUN OUTPUT
Specified versions:
Microsoft .NET SDK 5.0.303 (x64)
Microsoft .NET Core SDK 3.1.120 (x64)
*** END DRY RUN OUTPUT
However, when launching the command dotnet-core-uninstall dry-run --all --sdk all SDK versions are listed in the output.
*** DRY RUN OUTPUT
Specified versions:
Microsoft .NET SDK 5.0.303 (x64)
Microsoft .NET Core SDK 3.1.415 (x64)
Microsoft .NET Core SDK 3.1.120 (x64)
*** END DRY RUN OUTPUT
When launching the command dotnet-core-uninstall dry-run --all-lower-patches --aspnet-runtime nothing is displayed. The expected output should be...
@Strong-IT-IBK I believe this is the expected behavior, can you please explain why you believe that should be the output?
Since you're using the --aspnet-runtime switch the tool is only going to display aspnet runtimes, so it should be expected that no SDKs show up in the output.
@sfoslund I am sorry. I unintentionally specified --aspnet-runtime instead of --sdk. I fixed the command lines in my first edit. The actual command I launched is: dotnet-core-uninstall dry-run --all-lower-patches --sdk. However, nothing is displayed in the output even if lower patch versions of SDK are present on the system (see output above).
I am seeing the same thing.
From my understanding the following output indicates that the following SDK's can be uninstalled when using --all-lower-patches:
- 7.0.308 x64
- 7.0.202 x64
- 7.0.110 x64
As they are superseded by 7.0.404 (higher patch version AND the same architecture)
C:\Temp>dotnet-core-uninstall list --sdk
This tool cannot uninstall versions of the runtime or SDK that are
- SDKs installed using Visual Studio 2019 Update 3 or later.
- SDKs and runtimes installed via zip/scripts.
- Runtimes installed with SDKs (these should be removed by removing that SDK).
The versions that can be uninstalled with this tool are:
.NET Core SDKs:
7.0.404 x64 [Used by Visual Studio. Specify individually or use --force to remove]
7.0.308 x64
7.0.202 x64
7.0.110 x64
6.0.417 x64
5.0.408 x64 [Used by Visual Studio 2019. Specify individually or use --force to remove]
3.1.426 x64
2.2.207 x64 [Used by Visual Studio 2019. Specify individually or use --force to remove]
2.1.818 x64 [Used by Visual Studio 2019. Specify individually or use --force to remove]
2.1.526 x64 [Used by Visual Studio 2017. Specify individually or use --force to remove]
1.1.14 x64 [Used by Visual Studio. Specify individually or use --force to remove]
C:\Temp>dotnet-core-uninstall remove --sdk --all-lower-patches -v diag
The following items will be removed:
To avoid breaking Visual Studio or other problems, read https://aka.ms/dotnet-core-uninstall-docs.
Do you want to continue? [y/n] y
C:\Temp>