JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Run and debug .NET static methods

Last modified: 26 May 2024

In JetBrains Rider, you can execute any public static void method without parameters. This way, you can test specific algorithms or subsystems in your codebase without launching the whole application. If necessary, you can use console for interactive execution.

You can run a static method right from the editor by clicking in the gutter next to the method or pressing AltEnter and choosing the corresponding action:

https://resources.jetbrains.com/help/img/rider/2024.3/run-static-method.png
Gif

Everything executable in JetBrains Rider requires a run/debug configuration, and a static method is no exception — when you run it from the editor for the first time, JetBrains Rider creates a temporary configuration that you can save and reuse in the future.

Alternatively, you can add a configuration for a .NET static method in the Run/Debug Configurations dialog.