C# Tutorial · C# Basics · Lesson 2 of 22
C# Get Started
Install the .NET SDK, create a console app and run it.
Install the .NET SDK
Download the .NET SDK (8 or later) from dot.net, then check:
dotnet --version
Create and run a console app
dotnet new console -o HelloApp
cd HelloApp
dotnet run
dotnet new console creates HelloApp.csproj (the project file) and Program.cs. Replace Program.cs with:
Console.WriteLine("What's your name? (pretend we typed Ada)");
string name = "Ada";
Console.WriteLine($"Welcome to C#, {name}!");
Output
What's your name? (pretend we typed Ada) Welcome to C#, Ada!
Run this on your computer — see “Get Started” for setup.
Editors
Visual Studio (Windows), JetBrains Rider, or VS Code with the C# Dev Kit extension all give you IntelliSense, debugging and refactoring.
Test yourself
Which command creates a new console project?
dotnet create appdotnet new consolecsharp initdotnet init
Show answer
Answer: dotnet new console