microsoft / microsoft/winget-cli
Upgrading Microsoft.DotNet.SDK.7 leaves older version in the system and makes new one not fully visible to winget
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
Upgrading Microsoft.DotNet.SDK.7 via winget (that was in the past also installed via winget) leaves older version in the system and makes new one not fully visible to winget.
Steps to reproduce
Having Microsoft.DotNet.SDK.6 already installed may or may not matter (hard to tell).
Upgrade Microsoft.DotNet.SDK.7 via winget upgrade --all.
(winget upgrade Microsoft.DotNet.SDK.7 would possibly give the same result.)
Expected behavior
Older Microsoft.DotNet.SDK.7 is uninstalled.
Newer Microsoft.DotNet.SDK.7 is installed.
Microsoft.DotNet.SDK.7 remains fully visible/controllable from winget.
Actual behavior
Older Microsoft.DotNet.SDK.7 is not uninstalled.
Newer Microsoft.DotNet.SDK.7 is installed.
http://paste.przemoc.net/winget/WinGet-2023-02-15-11-59-13.872.log - log from winget upgrade --all (I do not have terminal dump as I did not expect issues, so wasn't as cautious as I should be)

Microsoft.DotNet.SDK.7 is seemingly not visible from winget.
PS> winget list Microsoft.DotNet.SDK
Name Id Version Source
-----------------------------------------------------------------------
Microsoft .NET SDK 6.0.406 (x64) Microsoft.DotNet.SDK.6 6.0.406 winget
But shows up in full list:
PS> winget list | findstr Microsoft.DotNet.SDK
Microsoft .NET SDK 7.0.102 (x64) Microsoft.DotNet.SDK.7 7.0.102 winget
Microsoft .NET SDK 7.0.200 (x64) Microsoft.DotNet.SDK.7 7.0.200 winget
Microsoft .NET SDK 6.0.406 (x64) Microsoft.DotNet.SDK.6 6.0.406 winget
And still shows up in upgrade:
PS> winget upgrade
Name Id Version Available Source
--------------------------------------------------------------------------------
Microsoft .NET SDK 7.0.102 (x64) Microsoft.DotNet.SDK.7 7.0.102 7.0.200 winget
1 upgrades available.
Environment
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.1265
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the upgrade with winget upgrade --all or winget upgrade Microsoft.DotNet.SDK. Compare the results of winget list Microsoft.DotNet.SDK, full winget list, and winget upgrade, then inspect the linked WinGet log and the reported Windows Package Manager environment. Done means the older SDK is removed and the newer Microsoft.DotNet.SDK.7 remains visible and controllable through winget.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100