[NETSDKE2E] [Dotnetup]dotnetup should not uninstall .NET SDK that is currently in use
- 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 ENU
Install dotnetup tool: iwr https://aka.ms/dotnetup/get-dotnetup.ps1 | iex
Add dotnetup to the PATH in Current session.
**Repro Steps**
1. Install the latest stable .NET SDK using following step:
`dotnetup init` > choose 'Yes, proceed with default and install'
2. Open a new PS terminal, using this .NET SDK to create a project. e.g. blazorwasm. Meanwhile Uninstall the latest stable .NET SDK (10.0.301) using following command in another PS terminal
`dotnetup sdk uninstall latest`
Expected Result
This .NET SDK is in use should be uninstalled with dotnetup
Actual Result
1. It shows that this .NET SDK is in used is uninstalled with warning
2. The latest .NET SDK is not shown in `dotnetup list` but `shown in dotnet --list-sdks` .
3. If Re-run `dotnetup init` or `dotnetup sdk install latest`, it shows installed successfully. But running dotnet new failed with error in a new PS terminal.
### dotnetup version
0.1.4-preview.6.26358.1+5a6ef780cc88ce7bcafcb3a9c5cfc70da5c3a313
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `dotnetup sdk uninstall latest` while the SDK is in use, then compare `dotnetup list` with `dotnet --list-sdks` in a new PowerShell terminal. Trace the dotnetup uninstall entry point and determine the intended behavior from the title and conflicting expected-result text; done means the in-use SDK is handled consistently without leaving the two listings or subsequent `dotnet new` command in a broken state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100