在C#代码中查找未捕获的exception

我想知道是否有一个工具可以使用静态代码分析在C#中找到未捕获的exception? 基本上我想选择一个方法A(),并希望找到methodA()抛出的所有exception的列表以及methodA()调用的所有方法。 我尝试过ReSharper + Agent Johnson和AtomineerUtils ,都失败了这个简单的任务。

这是我的示例代码:

public class Rectangle { public int Width { get; set; } public int Height { get; set; } public int Area() { CheckProperties(); long x = Width * Height; if (x > 10) throw new ArgumentOutOfRangeException(); return (int) x; } private void CheckProperties() { if (Width < 0 || Height < 0) throw new InvalidOperationException(); } } 

该工具应该能够告诉我(以任何forms)方法Area()将抛出ArgumentOutOfRangeExceptionInvalidOperationException.

我在IDE中使用了一个R#addin – Exceptional。 错误的想法,结果是它抱怨每一个字符串。格式调用和可能确实抛出的类似常见情况,但这不会导致问题。

如果值得, 请自行决定: https : //github.com/CSharpAnalyzers/ExceptionalReSharper