Debugging C# in Rider: Inline Variables and Smart Breakpoints That Actually Help
Rider's inline variable display and conditional breakpoints let you debug C# loops without stopping on every iteration. See values in your code and break only when your conditions are met.
19 Nov 2025, 16:42 UTC

The Problem: Chasing Ghosts in Your Debugger
When debugging a loop in C#, you probably set a breakpoint, hit it fifty times, and still can't tell which iteration matters. Traditional breakpoints either stop too early or require you to manually inspect variables in the debug pane every single time. JetBrains Rider solves this with two features that feel like cheating: inline variable display and conditional breakpoints that evaluate C# expressions.
See Variables Without Leaving Your Code
Rider's inline debugging shows variable values directly in the editor gutter during a debugging session. As your code pauses, you'll see current values appear right next to variables, with color-coded indicators showing modified values. This eliminates the constant alt-tabbing between your code and the debug tool window.
Conditional Breakpoints That Think Like You Do
Instead of breaking on every loop iteration, you can set a breakpoint that only triggers when a C# expression evaluates to true. Use syntax like i > 5 && user.IsActive to stop only when your specific condition is met. Rider evaluates these expressions in the current debugging context, so you have full access to all in-scope variables.Worked Example: Finding the Right Iteration
Consider this simple console app that processes a list of users:
public class User { public string Name { get; set; } public int Age { get; set; } }
var users = new List<User> {
new User { Name = "Alice", Age = 25 },
new User { Name = "Bob", Age = 17 },
new User { Name = "Charlie", Age = 30 }
};
for (int i = 0; i < users.Count; i++) {
var user = users[i];
// Set breakpoint here with condition: user.Age > 25
Console.WriteLine($"{user.Name} is {user.Age}");
}
To set the conditional breakpoint in Rider:
- Click in the gutter next to the Console.WriteLine line
- Select "Add Conditional Breakpoint" from the context menu
- Enter the condition:
user.Age > 25 - Start debugging - Rider will only break on Charlie's iteration
While debugging, you'll also see inline values for i and user displayed in the margin, so you can verify you're in the right iteration without opening any tool windows.Trade-offs and Limitations
Inline debugging can slow down your debugging session, especially when inspecting complex object graphs or large collections. The debugger needs to evaluate and format variable values in real-time, which introduces overhead. Conditional breakpoints that call methods or access properties may also impact performance if those operations are expensive.
Additionally, feature availability varies between Rider versions. Older releases may lack the color-coded modification indicators or advanced expression support. Remote debugging requires proper network configuration and may not work in all environments.Actionable Next Steps
Try this with your own project: find a loop that's hard to debug, set a conditional breakpoint using a meaningful expression, and watch the inline variable values appear. If you're debugging a .NET Core or .NET 5+ application, test the attach-to-process functionality to debug running services without restarting them.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.