问题
I found this solution: Debugging automatic properties
I tried to work with it, but it doesnt do anything. Does this solution to break at the setter still work?
As far as I've seen, all i have to do is creating a Breakpoint. My class has the name RecordCompetitionTitleBuilderIndividual, the Property EventData.
So I just set the Breakpoint at something like this:
RecordCompetitionTitleBuilderIndividual.set_EventData(null)
But this doesnt do anything. Am I doing something wrong, or is there a new possibility to make debugging a property happening?
Thanks and a good start in the new week!
Matthias
回答1:
Just set the breakpoint for the property name (without parameter and parentheses)
RecordCompetitionTitleBuilderIndividual.set_EventData
Just checked for VS2010
回答2:
You can actually use IL Disassembler to find the name of the setter and getter methods to set debugger on by pressing Ctrl+B.
There are also some VS plugins that can help you make this task easier by integrating it into VS, such as Oz Code, just inspect the object instance and click on the wand thingie to set conditional breakpoint on property set:
来源:https://stackoverflow.com/questions/18438485/reasking-about-hitting-breakpoint-at-property-setter