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

Viewed 1631

I am trying to get the 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:

enter image description here enter image description here

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 Answers

I had the same problem. In my case, the use of Fody was causing the problem, although the assembly was compiled in the Debug mode. After disabling Fody, I could see the variable value while debugging. I thought this might be useful for someone else. Please check if your project is using any IL manipulation tools, such as Fody.

Related