T

Install Dotnet Command Line

32 views · updated 2026-07-01 · published 2026-07-01 · by Hasarinda Manjula · Download Center Reading time: 2 min English සිංහල

How to Install Any .NET Version Using the Command Line

Use winget to install, update, and remove .NET runtimes and SDKs quickly.

Overview

The Windows Package Manager (winget) can install any .NET runtime or SDK from the command line — faster than downloading installers. This guide shows how to install, update, and uninstall .NET with winget.

Installing .NET from the command line.

Key Takeaways

  • winget installs .NET runtimes and SDKs by ID.
  • Runtime is for running apps; SDK is for building them.
  • Winget pulls packages from Microsoft’s official source.
  • You can update or uninstall the same way.

Runtime vs SDK

  • .NET Runtime — run .NET apps.
  • .NET Desktop Runtime — run WPF/WinForms apps.
  • ASP.NET Core Runtime — run web apps.
  • .NET SDK — build/develop .NET apps (includes the runtime).

Install .NET with winget

1. Open Command Prompt or PowerShell.

2. Search available versions: winget search Microsoft.DotNet

3. Install an SDK, e.g.: winget install Microsoft.DotNet.SDK.8

4. Install a runtime, e.g.: winget install Microsoft.DotNet.Runtime.8

5. Verify: dotnet --info

Update .NET

1. Upgrade a specific package: winget upgrade Microsoft.DotNet.SDK.8

2. Or upgrade everything: winget upgrade --all

3. Re-check with dotnet --list-sdks / --list-runtimes.

Uninstall .NET

1. List installed: winget list Microsoft.DotNet

2. Uninstall by ID: winget uninstall Microsoft.DotNet.SDK.8

3. Remove runtimes similarly if no longer needed.

Troubleshooting

Problem: winget not recognized.

Solution: Install "App Installer" from the Microsoft Store, which provides winget.

Problem: Wrong version installed.

Solution: Use the exact package ID (e.g., Microsoft.DotNet.SDK.8) from winget search.

Problem: dotnet command not found after install.

Solution: Open a new terminal so PATH refreshes, or sign out/in.

Problem: Multiple SDKs conflict.

Solution: That’s fine — .NET supports side-by-side versions; use a global.json to pin a project’s SDK.

Conclusion

winget makes .NET management effortless: search for the version, install the runtime or SDK by ID, and update or uninstall with a single command — all from Microsoft’s official source, no manual installers required.

Thanks for your feedback! 🙌

Read more

TechHub Assistant
Online · AI assistant
Thinking
⬇ Downloads 📦 Orders 🛒 Buy License 🎫 Create Ticket 🙋 Contact
AI-generated · may be inaccurate. Talk to a human