← Back to C# Course | Chapter 1: Setup & Basics | Lesson 2 of 7

Installing .NET

In this page:

  1. Installing .NET

Installing .NET

C# programs run on the .NET runtime, so you need the .NET SDK installed before you can compile or run any C# code. The SDK bundles the compiler, runtime, and the dotnet command-line tool. Installers are available for Linux, macOS, and Windows from the official .NET site.

Note: Run dotnet --version after installing to confirm the SDK is on your PATH.

Example: Installing .NET

bash
# Linux (Ubuntu/Debian)
sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0

# macOS (Homebrew)
brew install --cask dotnet-sdk

# Windows (winget)
winget install Microsoft.DotNet.SDK.8

# Verify installation (all platforms)
dotnet --version

⚠️ Run this command in your terminal.

🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.