Visual Studio DebuggerStepThrough for Property Setter

匆匆过客 提交于 2019-12-21 03:42:40

问题


I do not want to disable Visual Studio's normal handling of all exceptions. I am looking for a way to ignore the exceptions raised by the setter of a specific property. I am aware of [DebuggerNonUserCode] and [DebuggerStepThrough], but they don't seem to be applicable to properties, or more specifically setters.

Is this possible?


回答1:


I believe the problem you're running into is you're attempting to apply the attribute to the property instead of the individual accessors. The accessors are the actual methods and where the attribute needs to go. For example

int Property {
  [DebuggerNonUserCode]
  get { ... }
  [DebuggerNonUserCode]
  set { ... }
}


来源:https://stackoverflow.com/questions/7273647/visual-studio-debuggerstepthrough-for-property-setter

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