How to debug in dotnet core web Api Step by Step explain

Опубликовано: 11 Июль 2026
на канале: DotNet With Shivam
1,136
18

🎤 Explanation for Debugging .NET Core Web API
"Hey everyone! In this video, I’m going to show you how to debug a .NET Core Web API step by step.

Debugging is a key part of development — it helps us find out where our code is going wrong and fix it easily.

Step 1: Open the Project
First, open your ASP.NET Core Web API project in Visual Studio.

Step 2: Set Breakpoints
Next, go to the controller or service where you want to check the logic. Click on the left margin next to the line number — this sets a breakpoint. It tells the debugger to pause the code when it reaches this line.

Step 3: Start Debugging
Now, press F5 or click the Start Debugging button. This will launch the application and attach the debugger.

Step 4: Call the API
call the API endpoint that hits the code where your breakpoint is. The debugger will pause execution when it reaches that line.

Step 5: Inspect Variables
When the debugger stops at your breakpoint, you can hover over variables to see their values. You can also use the Watch Window, Locals Window, or Immediate Window to inspect and even change values at runtime.

Step 6: Step Through Code
Use the toolbar to:

Step Into (F11) – Go inside a method call

Step Over (F10) – Go to the next line without going into methods

Continue (F5) – Resume execution