检查异常捕获在C# [英] Checked exception catching in C#

查看:139
本文介绍了检查异常捕获在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java要求您捕获所有可能的异常,或者在方法签名中声明它们。这不是C#的情况,但我仍然觉得捕获所有异常是一个很好的做法。有没有人知道可以处理C#项目的工具,并指出抛出异常但未被捕获的地方?

Java requires that you catch all possible exceptions or declare them as thrown in the method signature. This isn't the case with C# but I still feel that it is a good practice to catch all exceptions. Does anybody know of a tool which can process a C# project and point out places where an exception is thrown but not caught?

推荐答案

查看Jason Bock针对.NET Reflector的ExceptionFinder插件。它只是你正在寻找。这是一个屏幕:

Check out the ExceptionFinder plug-in by Jason Bock for the .NET Reflector. It does just what you are looking for. Here's a screeny:

查看 CodePlex

这篇关于检查异常捕获在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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