How to get the name of the method that caused the exception
There’s a TargetSite property on System.Exception that should come in handy. Gets the method that throws the current exception. In your case, you probably want something like: catch (Exception ex) { MethodBase site = ex.TargetSite; string methodName = site == null ? null : site.Name; … } It’s worth pointing out some of the issues … Read more