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

C# Interactive

Last modified: 26 May 2024

JetBrains Rider includes a Read–Eval–Print Loop (REPL), which lets you experiment with C# code without compiling it.

As soon as the C# Interactive is started, you can write any C# expressions and evaluate them by pressing Enter.

https://resources.jetbrains.com/help/img/rider/2024.3/using-repl.png
Gif

All expressions that you execute during the session are recorded in history. To find a previously executed statement, use the Up/Down buttons or click Replay recent commands and choose the one you need.

If your experiments resulted in some useful code, you can create a new scratch file with the full transcript of the session. To do so, click Export transcript to scratch file icon_export.png on the toolbar.

On Windows, JetBrains Rider will automatically detect and use the csi.exe executable that ships with MSBuild. On Mac OS X and Linux, JetBrains Rider defaults to Mono’s csharp. In case JetBrains Rider cannot find the correct executable or if you want to use another JetBrains Rider REPL, you can customize the tool path (and arguments) on the Languages & Frameworks | C# Interactive page of JetBrains Rider settings CtrlAlt0S.