Installing the .NET 10 SDK and checking it works
Course contents (16 lessons)
- Getting started
- Installing the .NET 10 SDK and checking it works
- Your first console app and top-level statements
- The building blocks
- Variables and basic types
- Working with strings and interpolation
- Reading input and writing output
- Making decisions and repeating work
- Conditionals and switch expressions
- Loops: for, while, do and foreach
- Collections and methods
- Arrays and List of T
- Writing your own methods
- Objects and classes
- Classes and objects
- Properties, encapsulation and object initialisers
- Handling null safely
- Errors and files
- Exceptions: try, catch, finally and throw
- Reading and writing files
- Final project: expense tracker
- Expense tracker, part 1: planning, model and storage
- Expense tracker, part 2: the menu and summaries
What you are installing
C# is the language. .NET is the platform that runs it. To write and run C# on your own machine you need the .NET SDK. SDK means software development kit. It contains the compiler, the runtime that executes your programs, and the dotnet command-line tool that ties everything together.
This course uses .NET 10. It is a long-term support release, which means Microsoft supports it for three years. That matters for a learner. The code you write now will still be supported when you finish the course and start real projects.
Installing the SDK
Go to the official download page at dotnet.microsoft.com/download and pick the .NET 10 SDK, not just the runtime. The runtime can run programs but cannot build them.
Windows
Download the installer and run it. If you like the command line, this works too:
winget install Microsoft.DotNet.SDK.10
macOS
Download the installer package for your chip (Apple silicon or Intel) and run it. If you use Homebrew, brew install --cask dotnet-sdk installs the latest SDK.
Linux
Most distributions have .NET in their package manager. On Ubuntu the package is called dotnet-sdk-10.0. Package names change between distributions and versions, so check the official install page for your distribution if the name is not found.
Checking the install
Close any terminal that was already open. Open a new one so it sees the updated PATH. Then run this:
dotnet --version
dotnet --list-sdks
The first command prints the version of the SDK you are using. It should start with 10.. The second lists every SDK installed on the machine. It is normal to have more than one. If you have a newer SDK installed as well, that is fine for this course. The code we write works on .NET 10 and later.
If you see "dotnet is not recognized" or "command not found", the install did not finish or the terminal is old. Close it, open a new one, and try again. On Windows, restarting the machine fixes stubborn PATH problems.
Choosing an editor
You can write C# in any text editor, but a proper editor saves hours. There are three common choices.
- Visual Studio Code is free and light. Install the C# Dev Kit extension from the marketplace.
- Visual Studio Community is free for individuals and learners. It is heavier but has the best debugger on Windows.
- JetBrains Rider is a paid editor with a free tier for non-commercial use. Many professionals like it.
I use all three at different times. For this course, pick VS Code if you are unsure. It runs on every operating system, so the instructions look the same for everyone.
A terminal is part of the job
Many beginners avoid the terminal. Please do not. Throughout this course we create projects and run them with short commands. Learn four things now: how to open a terminal in a folder, how to change folder with cd, how to list files with dir (Windows) or ls (macOS and Linux), and how to go up one folder with cd ...
Make a folder for your practice work. Something like CSharpCourse in your Documents folder is fine. Every project from this course will live inside it.
Common mistakes
- Installing only the runtime. If
dotnet newsays no templates are found ordotnet buildfails, you likely have the runtime only. Install the SDK. - Using an old terminal. The PATH is read when the terminal starts. A terminal opened before the install will not find the command.
- Mixing up .NET Framework and .NET. .NET Framework is the old Windows-only version (4.8 and below). Modern .NET (5 and later) is the one we use. Many old tutorials online are for the old one, and their code may not match what you see here.
Try it yourself
- Install the .NET 10 SDK and run
dotnet --version. - Run
dotnet --list-sdksand find your version in the list. - Run
dotnet --infoand look for the line that names your operating system. This output is what people ask for when you report a problem online, so it is good to know where it is. - Create the practice folder and open it in your editor.
In the next lesson you will create your first project and run a real C# program.
dotnet --version
dotnet --list-sdks
This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.
Sign up free I already have an account