.NET Installation Guide

Get started with .NET on your preferred platform.

Welcome to .NET

.NET is a free, cross-platform, open-source developer platform for building many types of applications. This guide will walk you through the installation process for Windows, macOS, and Linux.

The .NET SDK (Software Development Kit) includes the .NET runtime, the .NET CLI (Command Line Interface), and other tools needed to build and run .NET applications.

W

Windows

Installing .NET on Windows is straightforward. You can use the recommended installer or the command line.

Recommended: Using the Installer

  1. Visit the official .NET download page.
  2. Select the latest LTS (Long Term Support) or STS (Standard Term Support) version. LTS is recommended for production environments.
  3. Download the appropriate Windows x64 installer (.exe).
  4. Run the installer and follow the on-screen instructions. Ensure that ".NET SDK" is selected for installation.

Alternative: Using Winget (Windows Package Manager)

If you have the Windows Package Manager (winget) installed, you can use the command line:

winget install --id Microsoft.DotNet.SDK --version 8.0.100

You can also install just the runtime if you only need to run .NET applications:

winget install --id Microsoft.DotNet.Runtime --version 8.0.100

Verify Installation

Open a new Command Prompt or PowerShell window and run the following command to check the installed SDK version:

dotnet --version

You should see the version number of the SDK you installed (e.g., 8.0.100).

M

macOS

Install .NET on macOS using the official installer or Homebrew.

Recommended: Using the Installer

  1. Go to the official .NET download page.
  2. Download the macOS x64 installer (.pkg).
  3. Run the installer and follow the prompts. The installer will automatically add .NET to your PATH.

Alternative: Using Homebrew

If you use Homebrew, you can install .NET with a simple command:

brew install --cask dotnet-sdk

To install only the runtime:

brew install --cask dotnet-runtime

Verify Installation

Open a new Terminal window and run:

dotnet --version

This should output the installed .NET SDK version.

L

Linux

.NET installation on Linux typically involves using package managers or downloading binaries.

Using Package Managers (Recommended for most distributions)

For distributions like Ubuntu, Debian, Fedora, CentOS, and others, using the package manager is the preferred method.

Ubuntu / Debian based

# Add 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 .NET SDK sudo apt-get update sudo apt-get install -y dotnet-sdk-8.0

Fedora / CentOS / RHEL based

# Install .NET SDK sudo rpm -ivh https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/packages-microsoft-prod.rpm sudo dnf install -y dotnet-sdk-8.0 # Or for older versions: sudo yum install -y dotnet-sdk-8.0
Note: Visit the official .NET Linux installation guide for specific instructions tailored to your distribution.

Verify Installation

Open your terminal and run:

dotnet --version

The output should confirm the installed SDK version.

What's Next?

Once .NET is installed, you can start building your first application.

  1. Create a new project using the .NET CLI:
    dotnet new console -o MyFirstApp
  2. Navigate into your project directory:
    cd MyFirstApp
  3. Run your application:
    dotnet run

Explore the extensive documentation and tutorials available on the Microsoft Learn .NET site.