← Back to C# Course | Chapter 1: Setup & Basics | Lesson 4 of 7

The dotnet CLI

In this page:

  1. The dotnet CLI

The dotnet CLI

The dotnet command-line tool creates, builds, and runs C# projects without needing an IDE. dotnet new console scaffolds a runnable console project, dotnet build compiles it, and dotnet run builds and executes it in one step. This tool is the standard entry point for .NET development on any platform.

Note: dotnet run rebuilds automatically if source files changed since the last build.

Example: The dotnet CLI

bash
# Create a new console project in the current folder
dotnet new console -o HelloApp
cd HelloApp

# Build without running
dotnet build

# Build and run in one step
dotnet run

⚠️ Run this command in your terminal.

🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.