You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some exception behavioral changes in the native Core Invoke implementation in #66357. Previously, exceptions thrown by the native code were not wrapped with TargetInvocationException and now they are. Mono should uptake these changes.
The changes are consistent with other exceptions thrown when Invoking - mainly exceptions are not wrapped when the caller's parameters are bad (wrong number of arguments, or wrong types) but are wrapped when the Target throws or does something incorrectly. This change also facilitates the design to move native code to managed by performing validation logic on the managed side and allows for other implementations of Invoke (such as future IL-emit version) to be simpler.
A breaking change issue will be created for consumers, but for now the Mono runtime should adjust to this by not catching these exceptions specially and let the normal TargetInvocationException logic wrap the exceptions.
Reproduction Steps
See the tests flags with ActiveIssue for this issue.
Expected behavior
The Mono runtime should let exceptions be re-thrown as TargetInvocationException.
Actual behavior
The Mono runtime does not re-throw as TargetInvocationException.
Activity
SamMonoRT commentedon Aug 4, 2022
@steveharter @BrzVlad -- Is this work necessary to be completed for 7.0.0 or can be moved to 8.0 ?