Install the .NET SDK and Write Your First Program

Dot NET Programming 12 min min read Updated: Nov 16, 2026 Beginner
Install the .NET SDK and Write Your First Program
Beginner Topic 2 of 5

Step 1: Install the .NET SDK

Download the .NET 10 SDK from the official site dotnet.microsoft.com/download and run the installer. The SDK includes the runtime, the compiler and the dotnet command.

SystemQuick install
WindowsInstaller from the website, or winget install Microsoft.DotNet.SDK.10
macOSInstaller from the website, or brew install --cask dotnet-sdk
LinuxUse your package manager (for example sudo apt install dotnet-sdk-10.0 on Ubuntu) or the install script

Check that it works. Open a new terminal window and type:

bash dotnet --versio
Result

You should see a version that starts with 10, for example 10.0.100. If you see 'command not found', close the terminal and open it again.

Step 2: Choose an Editor

EditorBest for
Visual Studio CommunityWindows users who want the full IDE with a designer and debugger
Visual Studio CodeAny system. Install the C# Dev Kit extension.
JetBrains RiderPopular paid alternative with a free non-commercial option

Step 3: Create a Console App

bash mkdir MyFirstApp cd MyFirstApp dotnet new console dotnet ru
Result

The terminal prints Hello, World!. You just ran your first .NET program.

Step 4: Read the Code

Open Program.cs. The modern template has just one line:

csharp Console.WriteLine("Hello, World!");
PartMeaning
ConsoleA class from the .NET library for the terminal
WriteLineA method that prints text and moves to a new line
"Hello, World!"A string, the text to print
;Every statement in C# ends with a semicolon
Top-level statements: Older tutorials show a class Program with a Main method. Modern C# lets you write the code directly in the file. It is the same program, with less boilerplate.

Step 5: Make It Interactive

csharp Console.Write("What is your name? "); string? name = Console.ReadLine(); Console.WriteLine($"Welcome to .NET, {name}!");
Result

If you type Ana, the program prints: Welcome to .NET, Ana!

$"...{name}..." is string interpolation. Anything inside curly braces is replaced by its value.

Common Problems

ProblemFix
dotnet is not recognizedRestart the terminal or the computer
Wrong SDK versionRun dotnet --list-sdks to see what is installed
Build errors with red textRead the first error. It names the file and line number.

Conclusion

You installed the SDK, created a console app and ran it with dotnet run. Every .NET project in this course starts the same way.

Quick Summary: dotnet new console, dotnet run, Console.WriteLine to print, Console.ReadLine to read.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators