In my C# object, I set a conditional breakpoint with the condition value == "Status"
in the setter of this property. Normally it's decorated with a PostSharp aspect, but I've commented that out in this case, and it's still having trouble.
public virtual string Name
{
get
{
return _name;
}
set
{
_name = value; // breakpoint here
}
}
The first time execution reaches the breakpoint, VS displays an error:
EDIT - for searchability, the message is this:
The following breakpoint cannot be set:
At (file).cs, line 137 character 17 ('(class).Name', line 12), when 'value == "Status"' is true
The function evaluation requires all threads to run.
Here's what the Threads window looks like:
Anyone seen this before, or have any ideas what might be causing the debugger to baulk at this seemingly-simple case? Might it have something to do with the sleeping thread?
Right-click the breakpoint symbol and select Conditions (or press Alt + F9, C). Or hover over the breakpoint symbol, select the Settings icon, and then select Conditions in the Breakpoint Settings window.
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
In short, right click on an existing breakpoint and select "Edit breakpoint", or right click on the breakpoint margin and select "Add conditional breakpoint".
This problem occurs because ASP.NET debugging isn't enabled on the application.
I once had this problem when I encountered a situation when it goes out of the execution of the base thread. A bit more information on the flow of your application will help. It seems to me like a race condition.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With