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.
- typed input
- C# expression and method
- CLR value or object state
Explain the core concept and runtime behavior of Get Started (Setup)
Core syntax or pattern
# 1. Create a new console app
dotnet new console -o MyFirstApp
# 2. Enter the project folder
cd MyFirstApp
# 3. Run the program
dotnet runThe 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
- typed input
# 1. Create a new console appTo 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.
- C# expression and method
cd MyFirstAppThe 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.
- CLR value or object state
dotnet runRun `dotnet new console`, `dotnet restore`, `dotnet build`, and `dotnet run`, then distinguish build failures from runtime failures.
- typed input
- C# expression and method
- 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.
# 1. Create a new console app
dotnet new console -o MyFirstApp
# 2. Enter the project folder
cd MyFirstApp
# 3. Run the program
dotnet runSetup steps
- .NET SDK: install it. Once the SDK is installed, you can use the
dotnetcommand. - For a code editor, you can use Visual Studio Code or Visual Studio.
- In the terminal, type
dotnet --versionand check that a version number shows up. dotnet new consolecreates a console project, anddotnet runruns the program.
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
# 1. Create a new console app
dotnet new console -o MyFirstApp
# 2. Enter the project folder
cd MyFirstApp
# 3. Run the program
dotnet runExpected: 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
Quick quiz 2 / 3
Quick quiz 3 / 3
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