Thuta Learning
C#
BasicProgrammingBeginner

Get Started (Setup)

C#Lesson 320 min

What you'll walk away with

  • Explain the core concept and runtime behavior of Get Started (Setup)
  • Test normal, boundary, and invalid cases independently
  • Write readable, type-safe, and testable C# code

Explain it simply

Get Started (Setup), in plain language

To run C# code on your local machine, you'll need the .NET SDK . An SDK is a development package that includes the compiler, runtime, and project tools. You can experiment in an online playground, but if you're going to build a real project, setting things up locally is the way to go.

Problem → Why → Solution

The problem — why this concept matters

Installing a newer SDK does not automatically change a project's target framework.

A common mistake

Assuming one successful happy path proves the code is correct, maintainable, and production-ready.

Core concept — understand how it works

The SDK includes the compiler, CLI, templates, and runtime. In 2026, .NET 10 is the current supported LTS; verify the installed SDK, target framework, and support lifecycle with `dotnet --info`, the project file, and the official support page.

Mental model
  1. typed input
  2. C# expression and method
  3. CLR value or object state

Explain the core concept and runtime behavior of Get Started (Setup)

Core syntax or pattern

csharp
# 1. Create a new console app
 dotnet new console -o MyFirstApp

# 2. Enter the project folder
 cd MyFirstApp

# 3. Run the program
 dotnet run

The SDK includes the compiler, CLI, templates, and runtime. In 2026, .NET 10 is the current supported LTS; verify the installed SDK, target framework, and support lifecycle with `dotnet --info`, the project file, and the official support page.

Read the code step by step

  1. typed input# 1. Create a new console app

    To run C# code on your local machine, you'll need the .NET SDK . An SDK is a development package that includes the compiler, runtime, and project tools. You can experiment in an online playground, but if you're going to build a real project, setting things up locally is the way to go.

  2. C# expression and methodcd MyFirstApp

    The SDK includes the compiler, CLI, templates, and runtime. In 2026, .NET 10 is the current supported LTS; verify the installed SDK, target framework, and support lifecycle with `dotnet --info`, the project file, and the official support page.

  3. CLR value or object statedotnet run

    Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

Execution flow
  1. typed input
  2. C# expression and method
  3. CLR value or object state

Success

Explain the core concept and runtime behavior of Get Started (Setup)

Failure

Installing a newer SDK does not automatically change a project's target framework.

To run C# code on your local machine, you'll need the .NET SDK. An SDK is a development package that includes the compiler, runtime, and project tools. You can experiment in an online playground, but if you're going to build a real project, setting things up locally is the way to go.

csharp
# 1. Create a new console app
 dotnet new console -o MyFirstApp

# 2. Enter the project folder
 cd MyFirstApp

# 3. Run the program
 dotnet run

Setup steps

  1. .NET SDK: install it. Once the SDK is installed, you can use the dotnet command.
  2. For a code editor, you can use Visual Studio Code or Visual Studio.
  3. In the terminal, type dotnet --version and check that a version number shows up.
  4. dotnet new console creates a console project, and dotnet run runs the program.
You should see
Hello, World!

Info

⚠️ Common mistake

dotnet is not recognized usually means the SDK isn't installed, it's not on your PATH, or you haven't restarted your terminal yet.

Real-world usage

How to apply it in a real project

Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

Mini challenge

Build it yourself

Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

  • Rebuild the example without copying it
  • Test a normal input and an edge case
  • Predict the compiler or output result before running it
csharp
# 1. Create a new console app
 dotnet new console -o MyFirstApp

# 2. Enter the project folder
 cd MyFirstApp

# 3. Run the program
 dotnet run

Expected: Explain the core concept and runtime behavior of Get Started (Setup)

Show hint

Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

Quick quiz 1 / 3

What best describes the core idea of Get Started (Setup)?

Quick quiz 2 / 3

Which mistake should you avoid first?

Quick quiz 3 / 3

How should this be applied in a real project?

What to remember

  • typed input → C# expression and method → CLR value or object state
  • The SDK includes the compiler, CLI, templates, and runtime. In 2026, .NET 10 is the current supported LTS; verify the installed SDK, target framework, and support lifecycle with `dotnet --info`, the project file, and the official support page.
  • Installing a newer SDK does not automatically change a project's target framework.
  • Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

.NET releases and support — Microsoft Learn

Easy traps

  • Installing a newer SDK does not automatically change a project's target framework.
  • Assuming one successful happy path proves the code is correct, maintainable, and production-ready.

Hands-on Exercise

Run `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.

You'll know it worked when: Hello, World!

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Get Started (Setup) | Thuta Learning