Hi Kevin,
We've confirmed it's a bug. Until we fix this, here are two possible work around a workaround:
1. Instead of catching ArgumentException, catch the TargetInvocationException then the inner exception is going to be the exception you're looking for. For example, the catch clause can look like that:
catch (System.Reflection.TargetInvocationException e)
{
if (e.InnerException.GetType() == typeof(ArgumentException))
{
exceptionThrown = true;
}
}
2. Instead of invoking the event, you can invoke the event handler method directly. So instead of:
Isolate.Invoke.Event(() => es.Event += (s, a) => { }, null, new EventArgs());
You can use:
Isolate.Invoke.Method(target, "es_Event", null, new EventArgs());
I'll let you know when we fix this.