Install the .NET SDK
This guide will walk you through installing the .NET SDK on your operating system. The .NET SDK includes the .NET runtime, the Common Language Runtime (CLR), and the .NET CLI.
Windows Installation
For Windows, you can use the recommended installers or the .NET CLI.
Recommended Installation
- Download the latest stable SDK installer for Windows from the official .NET download page.
- Run the downloaded executable file.
- Follow the on-screen instructions. The installer will add the .NET SDK to your system's PATH.
Using the .NET CLI (Windows Package Manager)
If you have Windows Package Manager (winget) installed, you can use the following command:
winget install --id Microsoft.DotNet.SDK.6
winget install --id Microsoft.DotNet.SDK.7
winget install --id Microsoft.DotNet.SDK.8
Replace 6, 7, or 8 with the desired .NET version.
macOS Installation
For macOS, you can use the installer package or Homebrew.
Recommended Installation (Installer Package)
- Download the latest stable SDK installer for macOS from the official .NET download page.
- Open the downloaded `.pkg` file and follow the on-screen prompts.
Using Homebrew
If you use Homebrew, run the following commands in your terminal:
brew install --cask dotnet-sdk
This will install the latest .NET SDK version.
Download .NET SDK for macOSLinux Installation
For Linux, you can use the package manager for your distribution or install from a binary archive.
Using Package Managers
Debian/Ubuntu:
sudo apt update
sudo apt install dotnet-sdk-8.0
Fedora:
sudo dnf update
sudo dnf install dotnet-sdk-8.0
CentOS/RHEL:
sudo yum update
sudo yum install dotnet-sdk-8.0
(Note: Package names and availability may vary by distribution and version. Always check the official .NET documentation for the most up-to-date instructions.)
Manual Installation (Binary Archive)
- Download the latest stable SDK binary archive from the official .NET download page.
- Extract the archive to a desired location (e.g.,
/usr/share/dotnet). - Add the extracted directory to your system's PATH environment variable.
Verify Installation
After installation, you can verify it by opening a new terminal or command prompt and running:
dotnet --version
This command should display the installed .NET SDK version.
Congratulations! You have successfully installed the .NET SDK. You're now ready to start building amazing applications.