Debugging code with Rider

Examine the runtime behavior of your application, identify problematic code, run through code step by step.

Step through Code, Inspect what is Going On

With the debugger in Rider, you can attach to a new or existing process, and place breakpoints to pause the application and see what is going on while executing your code.

In the debugger, you can inspect variables, the current call stack, step over/into specific methods, and more. The debugger supports all .NET frameworks, .NET Core, Mono, Xamarin, Unity, ASP.NET and ASP.NET Core, in standalone apps, web apps and unit tests.

Run Configurations

Debugging starts with Run Configurations, where you specify which project to run or debug.

When first creating or loading a project in Rider, a default run configuration is created, based on the project type, so minimal configuration is required to get started. In fact, for most application types, pressing the F5 keyboard shortcut should be sufficient to launch the debugger.

Breakpoints and Source Stepping

Breakpoints let you suspend the program execution at specific statement. You can then analyze variables values, call stack, and other program parameters, evaluate expressions, and step through the program. There are different breakpoint types in the Rider debugger.

You can step through code, and use tools like smart step into to debug nested calls.

Once your application is suspended, you can use the variables pane to get a closer look at the current state of your program. Make use of Pin to Top to customize how values are displayed without having to change your code.

See Also