I call function in .NET using Reflection (Method.Invoke). If an error occurs inside this method and exception is raised, debugger doesn't show actual code but stops at Invoke() call. I can retrieve exception information from InnerException but this is very inconvenient, compared to regular debugging with callstack available and so on. Can methods invoked using Method.Invoke be debugged like regular function calls?
My workaround is to create Timer and call method inside Tick()
:
GUI code -> call function via Method.Invoke -> function setups a Timer -> in Tick there is function body
Unfortunately it's not very pretty (and not suitable in some cases)