Visual Studio中DebuggerStepThrough物业二传手 [英] Visual Studio DebuggerStepThrough for Property Setter
问题描述
我不希望禁用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屋!