Why .NET SDK installer doesn't clean up after itself?

Vasya Pupkin 60 Reputation points
2024-09-03T16:46:02.4233333+00:00

When you install x86 .NET SDK on x64 system, it creates .dotnet folder in your %USERPROFILE%. The problem is, when you uninstall the SDK, it doesn't remove the folder it had created. Why doesn't it clean up after itself?

Thank you

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,921 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,166 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 32,376 Reputation points Microsoft Vendor
    2024-09-04T07:02:26.4966667+00:00

    Hi @Vasya Pupkin ,

    Considered user-specific and not directly tied to the installation of the SDK itself, the .dotnet folder typically stores user-level data such as environment variables, global tools, and configurations that may persist beyond the installation of the SDK.

    Some reasons why the uninstaller does not remove the folder include:

    User-Specific Settings: The folder may contain settings or global tools installed by the user that are independent of the SDK version. Automatically deleting the folder could result in data loss or disruption of other user-installed tools.

    Avoiding Accidental Data Loss: Uninstallers are generally cautious about removing user-specific directories to prevent accidentally deleting data that might still be in use. This approach reduces the risk of unintended consequences, especially if the user has multiple SDK versions installed.

    Shared Use: If the .dotnet folder is being used by multiple versions of the SDK or by other .NET-related tools, removing it could cause problems for other applications or SDKs still in use.

    If you want to clean it up manually after uninstalling the SDK, you can safely delete the .dotnet folder if you're sure that it is no longer needed.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.