Back to course

Your First Console Application: Hello World

.NET Zero to Hero: Master C# and Modern App Development

Hello World in C#

Let's create your first project. A console application is the simplest way to learn.

Create the project:

In your terminal: bash dotnet new console -n HelloWorldApp cd HelloWorldApp

The Code (Program.cs):

csharp Console.WriteLine("Hello, World!");

Run the project:

bash dotnet run

Explanation: Console is a class that represents the standard input/output. WriteLine is a method that prints text followed by a new line.