An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
To learn C# online with step-by-step instructions and know what to install, follow these paths and tools from Microsoft resources.
- Install the required software on the PC
For a typical beginner setup on a local machine:
- Install the latest .NET SDK so C# apps can be built and run.
- Install Visual Studio Code as the code editor.
- Install either the C# extension or C# DevKit for C# support in Visual Studio Code.
These prerequisites are called out in multiple tutorials and learning paths:
- The “Build .NET applications with C#” learning path lists:
- .NET SDK
- Visual Studio Code
- C# extension for Visual Studio Code
- Several C# tutorials list:
- .NET SDK (for example, .NET 10 SDK)
- Visual Studio Code
- C# DevKit extension
Once these are installed, C# console apps and other .NET projects can be created and run locally.
- Use step-by-step C# tutorials and learning paths
Microsoft Learn provides structured, guided content with hands-on exercises:
- For absolute beginners to C#:
- “Tutorial: Explore the C# language” starting with a Hello World program and progressing through variables and text.
- The broader “Introduction to C#” tutorial series, which includes:
- Hello world
- Numbers in C#
- Tuples and types
- Branches and loops
- For learning core language features and console apps:
- “Create and run simple C# console applications (Get started with C#, Part 2)” learning path, which uses Visual Studio Code and covers:
- Installing and configuring Visual Studio Code for C#
- Calling methods from the .NET class library
- Using
if,else, andelse if - Using arrays and
foreach - Writing readable code
- Guided and challenge projects to practice arrays, loops, and selection
- “Tutorial: C#
ifstatements and loops - conditional logic” for branching and looping in more depth. - “Tutorial: How to use integer and floating point numbers in C#” for numeric types and math.
- “Create and run simple C# console applications (Get started with C#, Part 2)” learning path, which uses Visual Studio Code and covers:
- For object-oriented programming in C#:
- “Explore object oriented programming with classes and objects” to learn classes, objects, and basic OOP patterns in a console app.
- For .NET and web development with C#:
- “Build .NET applications with C#” learning path, which includes modules on:
- Writing first C# code
- Introduction to .NET
- Managing dependencies with NuGet
- Debugging .NET apps in Visual Studio Code
- Working with files and directories
- Creating a web API with ASP.NET Core controllers
- “Tutorial: Get started with C# and ASP.NET Core in Visual Studio” if using the full Visual Studio IDE to build a web app.
- “Build .NET applications with C#” learning path, which includes modules on:
- Optional: Use GitHub Codespaces instead of local install
Many tutorials also support running entirely in the browser using GitHub Codespaces, which provides a ready-made C# development environment. In that case, only a GitHub account is needed; the .NET SDK and editor are preconfigured in the Codespace.
- Suggested learning order
A practical sequence using these resources:
- Install .NET SDK + Visual Studio Code + C# DevKit or C# extension.
- Work through the “Hello world” and “Explore the C# language” tutorial.
- Continue with:
- Numbers in C#
- Branches and loops
- Tuples and types
- Move to the “Get started with C#, Part 2” learning path to build console apps with arrays, loops, and conditions.
- Learn classes and objects with the OOP tutorial.
- When comfortable, follow the “Build .NET applications with C#” learning path and, if interested in web apps, the ASP.NET Core web app tutorial.
References:
- Build .NET applications with C#
- Tutorial: Explore the C# language
- Introduction to C
- Explore object oriented programming with classes and objects
- Tutorial: C#
ifstatements and loops - conditional logic - Create and run simple C# console applications (Get started with C#, Part 2)
- Tutorial: Get started with C# and ASP.NET Core in Visual Studio
- Tutorial: How to use integer and floating point numbers in C