Finding out what exceptions a method might throw in C#

后端 未结 4 1371
无人及你
无人及你 2020-12-08 00:40

Is there any way to find out what exceptions might be thrown by any method in .NET code? Ideally I want to see what might be thrown and choose which ones I want to handle. I

4条回答
  •  無奈伤痛
    2020-12-08 00:48

    After reading another article about this on StackOverflow, I built on top of that other answer to write a tool to do this, you can get the source code from GitHub here:

    Exception Reflector

    you can also read more here:

    http://steves-rv-travels.com/archives/167

提交回复
热议问题