dotnet / dotnet/sdk

[NETSDKE2E] [Dotnetup] Uninstall sdk completed with warnings 'Could not delete hostfxr.dll, clrjit.dll, and Microsoft.CodeAnalysis.CSharp.dll due to access denied‘

Open
#55,334 0 comments 0 reactions 0 assignees View on GitHub
Area-dotnetup untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Prerequisites

- [x] I have read the [dotnetup documentation](https://github.com/dotnet/sdk/tree/release/dnup/documentation/general/dotnetup).
- [x] I have searched for [existing dotnetup issues](https://github.com/dotnet/sdk/issues?q=is%3Aissue%20state%3Aopen%20label%3Adotnetup).
- [x] I have searched for [existing dotnetup discussions](https://github.com/dotnet/sdk/discussions/categories/dotnetup).

### Issue type

Bug report

### Description

**Install Steps:**
Clean machine: Win11 x64 25H2
Install dotnetup tool: iwr https://aka.ms/dotnetup/get-dotnetup.ps1 | iex

**Steps to reproduce:**
1. Lanuch PowerShell -> Execute below commands:
2. dotnetup init
3. dotnetup list
4. dotnetup dotnet new mstest -n mytestproj
5. cd .\mytestproj\
6. dotnetup dotnet build
7. dotnetup dotnet test
8. dotnetup sdk uninstall latest

**Actual Results:**
The below warnings will throw during uninstall process.
Warning: Could not delete 'host/fxr/10.0.10': Access to the path 'hostfxr.dll' is denied.
Warning: Could not delete 'sdk/10.0.302': Access to the path 'Microsoft.CodeAnalysis.CSharp.dll' is denied.
Warning: Could not delete 'shared/Microsoft.NETCore.App/10.0.10': Access to the path 'clrjit.dll' is denied.

Image

**Expected Results**
The SDK info should be removed normally, with no error.

### dotnetup version

0.1.4-preview.6.26358.1+5a6ef780cc88ce7bcafcb3a9c5cfc70da5c3a313

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the documented dotnetup workflow and reproduce the listed PowerShell commands on Windows 11, especially `dotnetup sdk uninstall latest` after `dotnetup dotnet test`. Investigate why hostfxr.dll, Microsoft.CodeAnalysis.CSharp.dll, and clrjit.dll remain locked; done means the SDK info is removed without access-denied warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.