Difference between dotnet Restore, Build & Run ( 01-D)
Understand what happens when you run the 3 most used dotnet cli commands.

Some developers struggle to understand what happens when you run these 3 commands. Understanding the difference let you made better decisions during the development workflow especially when creating a CI/CD pipeline to ship your code into different environment.
Dotnet Restore :
Downloads all the external packages (NuGet packages) your project depends on. Think of it like , Checking your shopping list and downloading everything from the store before you start cooking
What it does:
Reads your
.csprojorpackages.configConnects to NuGet
Downloads the required packages into your local machine (usually in
~/.nuget/packages/)Usually happens automatically with
dotnet buildin .NET Core and later versions
Dotnet Build :
Compiles your project source code into a
.dllor.exefile. Think of it like, Cooking the meal using the ingredients you got from the store.What it does:
Runs the compiler (Roslyn)
Turns your
.csfiles into IL (Intermediate Language)Outputs into the
/bin/Debugor/bin/Releasefolder
Dotnet Run
The
dotnet runcommand builds and immediately executes your .NET application. Think of it like pressing the "Play" button in Visual Studio — your app compiles and launchesWhat Happens When You Run
It performs these steps under the hood:
Restores NuGet packages (if needed)
Builds the project (compiles code)
Runs the app




