.NET Installation Guide

This guide will walk you through the process of installing the .NET SDK and runtime on your development machine. .NET is a free, cross-platform, open-source developer platform for building all kinds of applications.

1. Choose Your Installation Method

There are several ways to install .NET:

  • Recommended: .NET SDK - Includes the runtime and development tools. Install this if you plan to develop .NET applications.
  • .NET Runtime - Includes only the runtime. Install this if you only need to run .NET applications.
  • Visual Studio - If you are using Visual Studio, the .NET SDK is usually included or can be easily added.
  • Package Managers - Many operating systems offer .NET through their native package managers (e.g., apt, yum, brew).

For most users, downloading the .NET SDK is the best starting point.

2. Download the .NET SDK

Visit the official .NET Download page. You will see options for the latest LTS (Long-Term Support) and Standard Term Support versions.

Recommendation: For production environments and long-term stability, choose an LTS version (e.g., .NET 6, .NET 8). For the latest features, choose the latest release.

Select the appropriate installer for your operating system:

  • Windows (x64, x86, ARM64)
  • macOS (x64, ARM64)
  • Linux (various distributions like Ubuntu, Debian, Fedora, CentOS, etc.)
3. Installation Instructions

Windows

  1. Download the .exe installer from the .NET download page.
  2. Run the installer and follow the on-screen prompts. The default options are usually sufficient.
  3. The installer will add the necessary paths to your system's environment variables.

You can verify the installation by opening a new Command Prompt or PowerShell window and running:

dotnet --version

macOS

  1. Download the .pkg installer for your architecture (Intel or Apple Silicon).
  2. Open the downloaded file and follow the installer prompts.

Alternatively, you can use Homebrew:

brew install --cask dotnet-sdk

Verify the installation in a new Terminal window:

dotnet --version

Linux

Installation methods vary slightly by distribution. The recommended way is often using the official scripts or package managers.

Using Package Managers (Example for Ubuntu/Debian):

Add the Microsoft package repository:

wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
    && sudo dpkg -i packages-microsoft-prod.deb \
    && rm packages-microsoft-prod.deb

Install the .NET SDK:

sudo apt update
sudo apt install apt-transport-https -y
sudo apt install dotnet-sdk-8.0  # Replace 8.0 with your desired version

Using the Official Script (Recommended for broad compatibility):

Download and run the install script:

wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0 --runtime dotnet # Specify desired channel and runtime

Verify the installation in a new Terminal window:

dotnet --version
Ensure that the .NET installation directory is added to your system's PATH environment variable. The official installers and package managers typically handle this automatically.
4. Verify Installation

Open a new terminal or command prompt window and run the following command:

dotnet --info

This command will display information about your .NET installation, including the SDK version, runtime versions, and operating system details. If you see output with version numbers, your installation was successful!

5. Next Steps

Now that .NET is installed, you can start building your first application: