Skip to main content
CSharpUniversity ASP.NET and C# lessons

The search runs entirely in your browser over the published lesson list.

Stepping through code with the debugger

The debugger lets you stop time inside a running program. Instead of guessing what a value is, you look at it.

Set a breakpoint

Click in the margin beside a line of code to place a breakpoint. Run the project and trigger the page. Execution stops at that line and the editor shows the current values of every variable in scope.

Move through the code

  • Step over. Run the current line and stop at the next one.
  • Step into. Go inside the method that is being called.
  • Continue. Run on until the next breakpoint.
Watch the values. Hover over a variable to see what it holds right now. The gap between what you expected and what is there is usually the whole bug.

Debugging works best on code that builds cleanly and is readable. If a page throws an error in production rather than on your machine, the Error Handler project records the details for you.

New lessons by email

Leave your address and get a short note whenever a fresh lesson is published. No account needed and you can stop at any time.

Thank you. Your address has been noted in this browser session. Connect a mailing service to deliver the notes for real.