In this lesson, creating a Hello World C# Console Application is expained step by step with screenshots.
C# Hello World
1. Open Visual Studio
2. Select File/New/Project
3. Create new console app (.Net Framework)
4. Set HelloWorld as Project name
5. Click Create Button
6. As soon as the project is created, Program.cs will open.
namespace HelloWorld { class Program { static void Main(string[] args) { } } }
HelloWorld: namespace
Program: class
Main: method (Main method is the starting point of any C# program.)
7. Update the Main method as:
class Program { static void Main(string[] args) { Console.WriteLine("Hello Vitademy"); } }
8. Press the start button (green play icon on top) to run the console program.
Alternatively, use Ctrl+F5 keyboard shortcut.