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

Installing .NET

Installing .NET is like getting the game console before you can play a game. C# programs need the .NET tools on your computer before they can be built and run.

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 in your own terminal or Node.js environment.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
Common Mistakes
  1. Installing only the runtime and then trying to build projects, when building needs the .NET SDK.
  2. Not checking the install with dotnet --version, so a broken PATH goes unnoticed.
  3. Installing an SDK version that does not match the target framework of the project, so the build fails.
🔒

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.