Visual Studio中DebuggerStepThrough物业二传手 [英] Visual Studio DebuggerStepThrough for Property Setter

查看:199
本文介绍了Visual Studio中DebuggerStepThrough物业二传手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不希望禁用Visual Studio的所有正常的异常处理。我要寻找一个办法忽略由特定属性的setter方法抛出的异常。我知道 [DebuggerNonUserCode] [DebuggerStepThrough] ,但他们似乎并不适用于性能,或者更具体setter方法。

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.

这可能吗?

推荐答案

我相信你在运行到是你试图将属性应用于属性,而不是个别访问的问题。该访问是实际的方法,并且其中的属性需要去。例如:

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 { ... }
}

这篇关于Visual Studio中DebuggerStepThrough物业二传手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆