MSDN - .NET Documentation

Your comprehensive guide to installing and getting started with the .NET platform.

Installing .NET

.NET is a free, cross-platform, open-source developer platform for building many different types of applications. This guide will walk you through the process of installing .NET on your system, covering the .NET SDK and runtimes.

Whether you're developing web applications, desktop apps, cloud services, or mobile backends, having the correct .NET installation is the first step to success.

Prerequisites

Before you begin the installation, ensure your system meets the following basic requirements:

  • A compatible operating system (Windows, macOS, Linux).
  • Sufficient disk space (typically 500MB to 2GB depending on the components).
  • Administrator or root privileges for installation.

For detailed system requirements for specific .NET versions, please refer to the official .NET System Requirements page.

Installation Steps

The installation process can vary slightly depending on your operating system. We recommend using the official installers or package managers for the most straightforward experience.

Windows
macOS
Linux

Windows Installation

For Windows, you can download the .NET installers directly from the official Microsoft website.

1

Download the Installer: Navigate to the official .NET download page and select the desired .NET version (e.g., .NET 8.0). Download the Windows x64 installer (.exe).

2

Run the Installer: Double-click the downloaded .exe file. Follow the on-screen prompts. Ensure you select "Install .NET SDK" if you are a developer.

3

Accept Defaults: It's generally recommended to accept the default installation options unless you have specific customization needs.

Download .NET for Windows

macOS Installation

On macOS, you can use the Homebrew package manager or download the macOS installer package (.pkg).

1

Using Homebrew (Recommended): If you have Homebrew installed, open your Terminal and run:

brew install --cask dotnet-sdk
2

Using PKG Installer: Download the macOS installer (.pkg) from the official .NET download page and run it. Follow the installation wizard.

Download .NET for macOS

Linux Installation

For Linux, you can use the package managers provided by your distribution or install using the binary archives.

Example using apt (Debian/Ubuntu):

1

Install prerequisites:

sudo apt update && sudo apt install -y wget apt-transport-https && sudo 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 && sudo apt update
2

Install .NET SDK:

sudo apt install -y dotnet-sdk-8.0
3

Install .NET Runtime (Optional): If you only need to run .NET applications:

sudo apt install -y dotnet-runtime-8.0

For other distributions like Fedora, CentOS, or Alpine, please refer to the official Linux installation guide.

View .NET Linux Instructions

Verifying Your Installation

After installation, it's crucial to verify that .NET has been set up correctly. Open your terminal or command prompt and run the following commands:

dotnet --info

This command will display detailed information about your .NET installation, including the version of the SDK and runtime installed. If you see version information without errors, your installation was successful.

.NET SDK vs. .NET Runtime

It's important to understand the difference between the .NET SDK and the .NET Runtime:

  • .NET SDK (Software Development Kit): Includes everything you need to develop .NET applications. This means the .NET runtime, compilers, and development tools like the dotnet CLI. Install the SDK if you plan to write and build .NET code.
  • .NET Runtime: Includes the .NET runtime and libraries necessary to run .NET applications. You only need the runtime if you intend to execute existing .NET applications but not develop them.

Troubleshooting Common Issues

If you encounter problems, here are a few common solutions:

  • PATH Environment Variable: Ensure the .NET installation directory is added to your system's PATH environment variable. Most installers handle this automatically, but manual verification might be needed.
  • Conflicting Installations: If you have older versions of .NET installed, they might conflict. Consider uninstalling unused versions.
  • Firewall/Antivirus: Temporarily disable your firewall or antivirus software during installation if you suspect it's blocking the process. Remember to re-enable it afterward.
  • Permissions: Ensure you have the necessary administrator or root permissions to install software.

For more advanced troubleshooting, consult the official .NET troubleshooting guide.