Note: The reference code in this article is written in C#.
Build Your First C# Console App in Visual Studio (Step-by-Step Beginner Guide 2026)
If you are completely new to C#, this guide will help you create your first working console application in Visual Studio step by step.
You don’t need any prior experience — just follow along and run your first program successfully.
What is a Console Application?
A console application is a simple program that runs in a command-line window and displays output as text.
It is the best way to start learning C# because it focuses on logic instead of UI complexity.
Step 1: Install Visual Studio
Before starting, make sure you have Visual Studio installed.
- Download Visual Studio from Microsoft official website
- Install “.NET Desktop Development” workload
- Complete installation setup
Step 2: Create a New Project
- Open Visual Studio
- Click “Create a new project”
- Select Console App
- Choose C# as language
- Click Next
Step 3: Configure Your Project
- Give your project a name (e.g. FirstConsoleApp)
- Select location to save project
- Click Create
Step 4: Write Your First Code
You will see a default file like Program.cs. Replace or edit it like this:
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello World!");
}
}
Step 5: Run Your Application
- Press F5 or click Start button
- A console window will open
- You will see output: Hello World!
What You Just Learned
- How to create a C# project
- How to write simple code
- How to run a program in Visual Studio
Next Step After This
Once you are comfortable, try modifying the program:
- Print your name
- Take input from user
- Try variables and conditions
Final Thoughts
Congratulations — you just created your first C# application. This is the first step toward becoming a .NET developer.
Keep practicing small programs daily to build strong fundamentals.