System.Reflection.TargetInvocationException not being caught

后端 未结 2 850
孤街浪徒
孤街浪徒 2021-01-28 02:45

NOTE ADDED AFTER SOLUTION: An AccessViolationException was being thrown inside the method called by reflection. This was the reason the TargetInvocationException couldn

2条回答
  •  抹茶落季
    2021-01-28 03:35

    I am not sure I can replicate your issue, but this is how we get it and it work's just fine...

     Try
       'YOUR CODE'
     Catch ex As Exception
        'This is where we grab it from... It needs to be in this block to work...
        System.Reflection.MethodInfo.GetCurrentMethod.ToString
     End Try
    

    Let me know how it work's out for you?

提交回复
热议问题