Install the .NET 10 SDK & Set Up
Before you can write C#, you need the .NET SDK on your computer. The SDK (Software Development Kit) contains the C# compiler, the .NET runtime, the base class library and the dotnet command-line tool that you will use in every lesson.
In this lesson you will install the .NET 10 SDK, check that it works, pick an editor and create a tiny test program.
SDK or runtime?
The .NET download page offers several packages, and choosing the wrong one is the most common setup mistake.
| Package | What it does | Who needs it |
|---|---|---|
| .NET SDK | Builds and runs programs; includes all runtimes | Developers (you) |
| .NET Runtime | Only runs console programs | People who just use an app |
| ASP.NET Core Runtime | Only runs web apps | Servers that host a web app |
| .NET Desktop Runtime | Only runs Windows desktop apps | Users of WPF or Windows Forms apps |
Always install the SDK. It already contains every runtime, so you do not need to install them separately. Choose .NET 10, the current LTS (long-term support) release.
Installing on Windows
You have three good options. Pick one.
- Installer: open
https://dotnet.microsoft.com/download, choose .NET 10, and download the SDK installer for x64 (most laptops) or Arm64 (some newer thin laptops). Run it and accept the defaults. - WinGet: Windows 11 includes the Windows Package Manager. Open PowerShell and run the command below.
- Visual Studio 2026: if you install Visual Studio with the ".NET desktop development" or "ASP.NET and web development" workload, it installs a .NET 10 SDK for you.
winget install Microsoft.DotNet.SDK.10The SDK is installed into C:\Program Files\dotnet, and the installer adds that folder to your PATH. Close any terminal windows that were open during the install and open a fresh one, otherwise the dotnet command will not be found.
Installing on Linux and macOS
On Ubuntu 26.04 and 24.04, .NET 10 is in Ubuntu's own package feed:
sudo apt-get update
sudo apt-get install -y dotnet-sdk-10.0On older Ubuntu releases such as 22.04, you first add the .NET backports repository with sudo add-apt-repository ppa:dotnet/backports, then run the same install command. Other Linux distributions have their own packages; the official install pages list them.
On macOS, download the .pkg installer for .NET 10 from the same download page. Choose Arm64 for Apple silicon Macs (M1 and later) and x64 for older Intel Macs.
Check the installation
Open a terminal (PowerShell, Command Prompt or a Linux/macOS terminal) and ask dotnet for its version:
dotnet --version
dotnet --list-sdks10.0.100 10.0.100 [C:\Program Files\dotnet\sdk]
Your numbers will probably be a little higher, because Microsoft releases a patch roughly every month (for example 10.0.1xx or 10.0.2xx). What matters is that the first number is 10. If you have older SDKs installed too, --list-sdks shows all of them; the newest one is used by default.
For a full report, including the operating system and runtimes, run dotnet --info. Paste that output when you ask someone for help.
Choose an editor
You can write C# in any text editor, but a good editor shows errors as you type, completes code for you and lets you debug step by step.
| Editor | Platforms | Cost | Notes |
|---|---|---|---|
| Visual Studio Code + C# Dev Kit | Windows, Linux, macOS | Free for students and individuals | Light and popular; install the "C# Dev Kit" extension from Microsoft |
| Visual Studio 2026 Community | Windows | Free for students and individuals | Full IDE with designers and a powerful debugger |
| JetBrains Rider | Windows, Linux, macOS | Free for non-commercial use | Strong refactoring tools |
This course uses only the dotnet command in the terminal, so every example works with any editor. If you are unsure, start with VS Code and the C# Dev Kit: it is small, works on every system and shows you exactly what the terminal commands do.
Create and run a test app
Now make sure everything works end to end. Create a folder for your course work and run three commands:
dotnet new console -o HelloRohtak
cd HelloRohtak
dotnet runHello, World!
Here is what happened:
dotnet new consolecreated a new project from the "Console App" template in a folder namedHelloRohtak. A project is a folder with a.csprojfile that describes how to build your program.cd HelloRohtakmoved into that folder.dotnet runcompiled the code and ran it. The first run takes a few seconds; later runs are faster because only changed files are rebuilt.
If you see Hello, World!, your setup is complete. You will look inside this project in the next lesson, Your First C# Program.
Common mistakes
dotnetis not recognised. The terminal was opened before installing. Close it and open a new one. If it still fails on Windows, check thatC:\Program Files\dotnetis in yourPATH.- Installed the runtime, not the SDK.
dotnet --list-sdksprints nothing. Install the SDK. - "No .NET SDKs were found." On Windows this usually means both the 32-bit (x86) and 64-bit SDKs are installed and the x86 one comes first in
PATH. Remove the x86 SDK unless you really need it. - Running
dotnet runin the wrong folder. It needs a project in the current folder. Usecdto move into the folder that contains the.csprojfile.
Key points
- Developers install the .NET SDK, which includes the compiler, the
dotnettool and all runtimes. - Install .NET 10 with the official installer,
winget install Microsoft.DotNet.SDK.10, orapt-get install dotnet-sdk-10.0on Ubuntu. dotnet --version,dotnet --list-sdksanddotnet --infoshow what is installed.- VS Code with the C# Dev Kit, Visual Studio 2026 and Rider are all good editors.
dotnet new console -o Namecreates a project anddotnet runbuilds and runs it.
Exercise
Install the .NET 10 SDK and check it with dotnet --version. Then create a console project called PuneCafe, run it once, and finally list every SDK installed on your computer. Write down the commands you used, in order.
Show solution
dotnet --version
dotnet new console -o PuneCafe
cd PuneCafe
dotnet run
dotnet --list-sdksdotnet --version should print a number starting with 10.0, and dotnet run prints Hello, World! because the template's Program.cs contains that line. dotnet --list-sdks works from any folder.
Quick Quiz
1. Which package should a developer install?
The SDK contains the compiler and tools and also includes every runtime.
2. Which command shows all installed SDK versions?
dotnet --list-sdks prints each SDK version and the folder it is installed in.
3. You installed .NET but the terminal says dotnet is not recognised. What should you try first?
A terminal opened before the install still has the old PATH; a new terminal picks up the change.
4. What does dotnet new console -o HelloRohtak do?
dotnet new creates a project from a template, and -o names the output folder.
Learn C# with a mentor
Free lessons get you started. Our Programming & Software Development training adds real projects and code reviews from working developers.
- Project-based learning
- Mentor code reviews
- Free counselling call
