"The condition for the breakpoint could not be fulfilled ..." variable "was not declared. It may not be available ..." Why?

Related questions:

I am having a problem with conditional breakpoints in Visual Studio 2013 Professional. A breakpoint condition refers to a local variable ( tagString ) that is declared and initialized in the line of code immediately preceding the breakpoint. When colliding with a breakpoint, the debugger claims that ...

The condition for the breakpoint failed. The condition was tagString.Contains("…") . Error returned: " tagString not been declared. It may not be available due to its level of protection.

This error message makes no sense since the variable is declared and available:

Screenshot demonstrating the issue

I run the Debug build of this code. Why does the debugger claim that the local variable is not defined and how can I solve this problem?


PS: I just realized that a conditional breakpoint doesn’t work - this is only a small part of a larger problem: the debugger also cannot monitor this variable and will not appear in the Locals window.

PPS: I tried the recommendations in Rick Strahl's blog entry, “Visual Studio 2013” ​​Failed to evaluate the expression “Debugging the debugger” , to no avail.

+5
source share

Source: https://habr.com/ru/post/1207280/


All Articles