JetBrains Rider 2024.3 Help

Interact with program using Immediate window

Immediate Window lets you access objects and functions available in the suspended state of your program.

The window becomes available and starts accepting your input as soon as your program is suspended in a debugging session. You can see the window below the variables pane of the Debug window.

To show or hide the window, click the corresponding icon on the toolbar of the variables pane.

Evaluate expressions

You can type any expression that reference anything available in the current context and then press Enter. You will see the result right below the expression and it will be added to the history of the executed lines for the current session. The result of the last evaluated expression is also shown in the $result variable in the variables tab:

JetBrains Rider: Evaluating expressions in the Immediate Window

Execute functions

You can call any member functions on the available objects or any static functions available in the current context using any available objects as arguments — type the call and press Enter. The semicolon at the end of the call is optional.

Breakpoints on the execution path of the function will suspend the execution as if it were a normal call. The call will have its own part of the stack starting with Function Evaluation, which you can explore in the Frames panel:

JetBrains Rider: Execution functions in the Immediate Window

When the call is complete, it will not change your current execution point Execution pointer even if it encounters an unhandled exception, but if the function changes any objects, the changes will apply to the current program state.

Create temporary variables

You can create temporary variables (also called synthetic variables) and use them to store values during the debugging session as well as to interact with other objects, as shown in the example below. Note that for assignment statements you must type semicolon at the end before you press Enter.

JetBrains Rider: Synthetic variables in the Immediate window

Modify objects

The example above also shows how the objects can be modified. Generally, you can assign any compatible values to the objects in scope and change their values using write-access methods.

Use other features

In the Immediate Window, you can press Up/Down to cycle through the executed lines (the history of the input is saved in the project settings), and use some of the familiar editor features:

Last modified: 11 February 2024