Some variables do not exist in the current context in Rider Debugger mode


I am trying to inspect the values of local variables. This feature works for some variables. For those that it doesn't, Rider brings up an error:

The name `variable_name` does not exists in the current context.

And image example of code and debugger watch error:

This is decompiled code, but even here it works for some local variables. What could be the fix for this?

I already check Settings->Build, Execution, Deployment->Disable JIT optimization on module load (.NET/.NET Core only), but as it says, it only works for .NET/.NET Core modules.

1 comment
Comment actions Permalink


Could you please clarify what runtime are you using? Would it be possible to provide me with a sample so we could check it on our side? Is there any chance that you have attached a debugger to an already running process? So far it looks like possibly variable was inlined. The debugger does not always suppress all optimizations. 


Please sign in to leave a comment.