问题
The above code has a conditional breakpoint set at its bottom line in yellow followed by the Breakpoint Settings dialog which should work with: item.Value == "aday"
However I get the below error, I have searched online for this and can't find any reason why this should fail. Im using VS 2015 Pro.
EDIT- Thank you for pointing out the obvious error on my part, I do normally code in C#. But now using a single '=' I get this??????? I assume that I it equates to an assignment, and adding parenthesis didn't help either?
回答1:
Just tested with a sample VB.NET project.
The problem is the ==
. This is C# syntax but since you have a VB.NET application you should use a single equal
item.Value = "aday"
(I have always something new to learn from SO)
回答2:
I am using the C# in Visual Studio 2017.
After search in an hour, conclusion was:
rewrite the conditional expression from:
item.Value == "aday"
to:
item != null && item.Value == "aday"
MAKE SURE item was not null. so that you can refer to field of value with item.Value
回答3:
If item.Value.Equals("aday") Then 'Temp If please remove
Debugger.Break()
end if
Actually works in strict mode, Gasp!!!!
Thanks to all contributions, greatly appreciated :)
来源:https://stackoverflow.com/questions/36479548/conditional-breakpoint-not-working