Get Method name that threw exception

前端 未结 3 2036
無奈伤痛
無奈伤痛 2020-12-09 16:57

I know. A similar question has already asked.

  • How to get the name of the method that caused the exception

but I haven\'t got the exact solution

3条回答
  •  离开以前
    2020-12-09 17:21

    Just try this:

    var methodFullName = exception.TargetSite.ReflectedType.FullName 
    

提交回复
热议问题