C# VS2026
Lesson 01 of 30

Introduction to C# in Visual Studio 2026

C# in Visual Studio 2026 — a hands-on guide for developers at every level.

What is C#?

C# (pronounced C sharp) is a modern, general-purpose, statically-typed programming language developed by Microsoft as part of the .NET platform. First released in 2002, C# has evolved through thirteen major versions and today powers desktop applications, web APIs, mobile apps with .NET MAUI, cloud services, and games through the Unity engine.

C# combines the raw performance of C++ with the safety and productivity of a managed runtime. The compiler catches type errors before the program ever runs, and the .NET garbage collector handles memory automatically so you can focus on writing features.

Setting Up Your Environment

You need two things: the .NET SDK and Visual Studio 2026.

  1. Download the .NET 9 SDK from dotnet.microsoft.com and run the installer.
  2. Download Visual Studio 2026 Community (free) from visualstudio.microsoft.com.
  3. In the Visual Studio Installer, select the .NET desktop development workload and click Install.
💡 Tip
The Community edition is completely free for individuals, students, and open-source projects. It includes every feature you need for this course.

Your First C# Program

Open Visual Studio 2026, choose Create a new project, select Console App, name it HelloWorld, and click Create. Replace the contents of Program.cs with:

// Program.cs – Hello World in C#
Console.WriteLine("Hello, World!");

Press F5 or click the green Run button. You should see Hello, World! printed in the terminal window at the bottom of the screen.

Understanding the Code

Modern C# (version 9+) supports top-level statements, which means you no longer need to wrap your code in a class or Main method. The compiler generates that boilerplate for you. The single line above is a complete, valid C# program.

â„šī¸ Note
C# is case-sensitive. Console and console are different identifiers. Always match the capitalisation shown in examples.

Running Without the IDE

You can also run C# from the terminal using the .NET CLI:

dotnet new console -n HelloWorld
cd HelloWorld
dotnet run

This is useful for quick experiments, but Visual Studio 2026 provides a much richer experience with IntelliSense, debugging, and hot reload — all of which you will use throughout this course.