Install .NET with Winget: Commands and Package IDs

To install .NET with winget, open a terminal and run winget install Microsoft.DotNet.SDK.10, or swap in the Runtime, AspNetCore or DesktopRuntime package for the version you need. Microsoft documents winget packages for .NET 10, 9 and 8, and winget search Microsoft.DotNet.SDK lists what is available on your PC.
Windows administrators and regular users can use the Windows Package Manager to install, update and remove .NET, without hunting for installers or worrying about dependencies.

Winget commands for installing .NET
Microsoft's documentation lists four package families per .NET version, and you replace the number with 10, 9 or 8. If you install the SDK, you do not need the matching runtime.
- Microsoft.DotNet.SDK.10: the SDK for developers, includes the runtimes.
- Microsoft.DotNet.Runtime.10: the base runtime for console apps.
- Microsoft.DotNet.AspNetCore.10: runtime for web apps.
- Microsoft.DotNet.DesktopRuntime.10: runtime for WPF and Windows Forms desktop apps.
To run every type of .NET app, Microsoft recommends installing both the ASP.NET Core runtime and the Desktop runtime. Run the commands in an administrator terminal for a system-wide install. The full list is in Microsoft's .NET on Windows install guide.
How to find the right .NET package
Run winget search Microsoft.DotNet in a command prompt or PowerShell window to list the available .NET packages with their IDs and versions. Then install a package with its ID.
winget search Microsoft.DotNet
winget install <package-id>
For example, to install the .NET 8 desktop runtime you would run the following command.
winget install Microsoft.DotNet.DesktopRuntime.8
If winget reports that a package was not found, the ID or version does not exist in the source. Check the spelling against the search output.
Update and uninstall .NET with winget
Run winget upgrade to list every package with an update, and upgrade a single package by ID.
winget upgrade <package-id>
The command winget upgrade --all updates everything, so check the list first, because you may not want all updates at once. To remove a package, use the same ID.
winget uninstall <package-id>
Our guide on updating all installed programs with the Windows Package Manager covers the upgrade workflow in detail.
Older .NET versions and .NET Framework 4.8
Older packages that were listed in 2022 are no longer a good choice. When this article was first written, winget offered the .NET 3.1, 5.0, 6.0 and 7.0 (preview) runtimes and SDKs, plus .NET Framework 4.8 and the .NET Core SDK Uninstall Tool. Microsoft's current guide documents packages only for .NET 10, 9 and 8, and it notes that .NET 6 support ended on November 12, 2024. Use a supported version unless an app requires an older one, and check the .NET support policy for dates. For .NET Framework 4.8, see our offline installer guide.
Where to get winget
Winget is bundled with current versions of Windows 10 and 11, and it is also available on GitHub and in the Microsoft Store. If you prefer a graphical interface, Winstall and WingetUI wrap winget in a GUI. Microsoft released Windows Package Manager 1.0 in 2021.
Now You: which .NET versions do you have installed on your devices? (Original tip via Deskmodder)
Related: Update all programs with winget, .NET Framework 4.8 offline installer
The only .NET needed is 6.0.x that is the latest LTS version.
I solely used winget to install StartAllBack and remove all of the junk that comes with Windows.
You can use -s winget at the end, so it will only search for winget repository and not the Store one, especially if you don’t want to agree to the terms of Store and you don’t want to say No all the time.
Winget is pretty good, I use it also to notify me about updates even if I decide to manually update my programs for any setting I need to cover that silent installations might ignore or apply.
Few days ago I saw someone struggling installing redis c++ on a stream, so it would have been easier just to say ‘use winget’ and done.