0Pricing
C# Academy · Lesson

First Program: top-level statements vs Program class; build & run

Compare top-level statements with the classic Program class, then build and run with the dotnet CLI; finish with quick debugging tips.

Two entry styles

Goal: See two ways to write your first app: top-level statements and the classic Program class with Main.

  • Same behavior, different style
  • Pick the style that is simplest for your sample

Build & run

dotnet CLI basics:

  • dotnet new console – create project
  • dotnet build – compile
  • dotnet run – build and run

All lessons in this course

  1. What is C#, CLR/.NET, JIT vs AOT, SDK & dotnet CLI
  2. First Program: top-level statements vs Program class; build & run
  3. Project layout, NuGet restore, debugging basics
← Back to C# Academy