The name "blah" does not exist in the current context

Why does this happen all the tine when debugging code?

It happens regardless of the framework (I'm currently using NET6), and has been the bane of my life for the last few years.

It's been asked about dozens of times, with solution varying from invalidating caches to ensuring things are running in Debug mode, but nothing seems to resolve it reliably.

The most infuriating thing is that Visual Studio doesn't have this issue. Sure it has other problems, but the debugging experience in Rider is truly awful in anything but the most basic project!

Here's a typical example of the problem. Debugging an internal exception in a third-party component, and the 'command' object is hidden. All of the other local variables are accessible, but why not the command object that I want to examine?

Given that I've experienced it in most debugging sessions for the last couple of years, I can't believe it's difficult to reproduce.

I can step into the `ExecuteNonQueryAsync` in the screenshot below and reference it as `this` to get the DbCommand instance, but why on earth is it not accessible from the context show below??

1 comment

Hi Jason Sobell

This error could be caused by several reasons. E.g. one of the causes was fixed in Rider 2022.1.

What Rider version do you use? The best way to investigate the issue properly is to report it via `Help | Report a bug` along with attached logs. If you could attach a solution or its part it would also help. 

Thank you in advance! 


Please sign in to leave a comment.