Setting Up .NET
To write and run C# you need the .NET SDK, which includes the compiler, the runtime and the dotnet command, plus a code editor. Everything is free and works on Windows, macOS and Linux. This lesson walks through installing the SDK, checking it works and choosing an editor.
SDK or runtime?
Microsoft publishes two kinds of download. The runtime only runs finished .NET programs. The SDK (software development kit) can also build them, and it includes a runtime. As a developer, you want the SDK. This course uses .NET 10; any later SDK also works, because newer SDKs can build older targets.
Windows
Download the .NET 10 SDK installer from dotnet.microsoft.com/download and run it, or install from a terminal with the Windows package manager:
winget install Microsoft.DotNet.SDK.10
Installing Visual Studio 2026 with the "ASP.NET and web development" or ".NET desktop development" workload also installs the SDK.
macOS
Download the macOS installer (.pkg) from the same page — choose Arm64 for Apple silicon Macs (M1 and later) or x64 for older Intel Macs. If you use Homebrew, this installs the latest SDK:
brew install --cask dotnet-sdk
Linux
Most distributions package .NET. On Ubuntu and Debian-based systems:
sudo apt update sudo apt install dotnet-sdk-10.0
On Fedora use sudo dnf install dotnet-sdk-10.0. If your distribution doesn't have .NET 10 yet, Microsoft's download page lists its own package feeds and an install script that works anywhere.
Checking the installation
Open a new terminal window (so it picks up the updated PATH) and ask for the SDK version:
dotnet --version
10.0.401
Any version starting with 10. or higher is fine. To see every SDK and runtime installed side by side, use:
dotnet --list-sdks dotnet --info
If the terminal says dotnet: command not found (or "not recognized" on Windows), close and reopen the terminal; if that doesn't help, sign out and back in, or reinstall and make sure the installer finished.
Choosing an editor
| Editor | Platforms | Notes |
|---|---|---|
| Visual Studio Code + C# Dev Kit | Windows, macOS, Linux | Free, lightweight. Install the C# Dev Kit extension from the Extensions view for code completion, error highlighting, debugging and a test explorer. |
| Visual Studio 2026 | Windows | Microsoft's full IDE. The Community edition is free for individuals, students and open-source work. |
| JetBrains Rider | Windows, macOS, Linux | A powerful cross-platform IDE; free for non-commercial use. |
For this course any of them works — or even a plain text editor and a terminal. The examples only need the dotnet command.
Telemetry
The SDK sends anonymous usage data to Microsoft by default. To opt out, set the environment variable DOTNET_CLI_TELEMETRY_OPTOUT to 1 in your shell profile:
export DOTNET_CLI_TELEMETRY_OPTOUT=1 # macOS / Linux (add to ~/.zshrc or ~/.bashrc) setx DOTNET_CLI_TELEMETRY_OPTOUT 1 # Windows
Running C# without installing
If you can't install anything right now, online playgrounds such as SharpLab or .NET Fiddle compile and run C# in the browser. They're handy for quick experiments, but install the SDK as soon as you can — later lessons work with files, projects and packages.