开发者

How to find an ignored exception

Probably staying late fixing a few bugs tonight, but maybe SO can help me out. Does anyone know if there's a way to 'track' where some ignored exceptions are occurring?

Basically I'm finding some System.OverflowExceptions in System.Drawing which are causing some graphics to not get painted (red X box syndrome).

Problem is, I can only tell this from the Debug window, and can not for the life of me find where this is being thrown. I'm guessing the coder of where this is happening wrote a

try{ something } finally { blah }

or...

try {something } catch { //Blah blah blah }

If I'm SOL 开发者_如何学编程as far as that goes, maybe somebody might know what methods in System.Drawing may cause a StackOverflow excption...

Thanks!


You can configure the debugger to break on an exception even if it has been handled.

You can configure the behavior via Debug -> Exceptions.... In your specific case you should check Debug -> Exceptions... -> Common Language Runtime Exceptions -> System -> System.OverflowException:

How to find an ignored exception


(source: scatterbright.com)


You may be able to use FxCop/StyleCop to get what you want. I'm not sure if you would need a custom rule to find your try/finally scenario.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜