.Net core SDK Clean Removal

Krishnareddy K 31 Reputation points
2024-01-30T19:43:05.2666667+00:00

We have identified multiple vulnerabilities every month due to the .Net core (like 6.0, 7.0, and 8.0). This is because the latest update removes the older version, but doesn't delete the older files. This became very challenging to remove these files from 10k machines. Please assist with the solution how to manage the removal for .NET core. An example is shown below.

Path              : C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\7.0.11
  Installed version : 7.0.11
  Fixed version     : 7.0.12



  Path              : C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App\6.0.22
  Installed version : 6.0.22
  Fixed version     : 6.0.23



  Path              : C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App\7.0.11
  Installed version : 7.0.11
  Fixed version     : 7.0.12
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,232 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,130 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 57,731 Reputation points
    2024-01-30T22:32:10.3233333+00:00

    patch installs are just side by side. if you google, you will see you are not alone and there is no great solution.

    see uninstall tool (latest options)

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

    you will need to install the tool on all your machines, then run after a patch.

    dotnet-core-uninstall --all-but-latest