Reasking about hitting breakpoint at property setter

好久不见. 提交于 2020-01-09 08:06:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!