.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.
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.
Visit the official .NET Download page. You will see options for the latest LTS (Long-Term Support) and Standard Term Support versions.
Select the appropriate installer for your operating system:
- Windows (x64, x86, ARM64)
- macOS (x64, ARM64)
- Linux (various distributions like Ubuntu, Debian, Fedora, CentOS, etc.)
Windows
- Download the
.exe
installer from the .NET download page. - Run the installer and follow the on-screen prompts. The default options are usually sufficient.
- 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
- Download the
.pkg
installer for your architecture (Intel or Apple Silicon). - 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
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!
Now that .NET is installed, you can start building your first application:
- Getting Started with .NET
- Using the .NET CLI
- Explore .NET templates for various project types (console apps, web APIs, Blazor, etc.).