Description
As discussed by mail:
Matthias:
Note that the exception actually is a
TargetInvocationException
. But for some reason,AsmBrowser.Invoke()
(implemented inAsmHelper.cs
~line 1507ff) suppresses thisTargetInvocationException
and only re-throws the innerTypeLoadException
.
Oleg:
As for the second problem "re-throwing an inner exception" it is a deliberate choice. The first exception is a Remoting transport container and it never reflect the nature of the runtime error (thrown by the script). However if it creates problems with troubleshooting then please log a feature request to make it optional.
Rationale for this change request:
Only the original TargetInvocationException
contains the stack frame (i.e. code location) where the problem occurs the first time. This piece of information can be very helpful in debugging such issue.