Hello again!
We've investigated this some more, and it turns out that the
In other words, the exception doesn't make it out of .NET code, and that's why your code continues to run. Your
At first we thought we couldn't reproduce the exception because we didn't see it in the debugger, but that was because Visual Studio is configured to ignore
The bottom line is that you can use the original simple form:
This is recommended over
Thanks for all your help!
We've investigated this some more, and it turns out that the
RuntimeBinderException
is absolutely not a concern. It is thrown and handled internally within the C# Runtime Binder.In other words, the exception doesn't make it out of .NET code, and that's why your code continues to run. Your
AppDomain.FirstChanceException
handler has nothing to do with it. From MSDN: "This event is only a notification. Handling this event does not handle the exception or affect subsequent exception handling in any way."At first we thought we couldn't reproduce the exception because we didn't see it in the debugger, but that was because Visual Studio is configured to ignore
RuntimeBinderException
by default. Once we set up a logging handler similar to yours, we saw it.The bottom line is that you can use the original simple form:
engine.Script.moduleLoader = new ModuleLoader(engine);
Activator.CreateInstance()
and should perform much better.Thanks for all your help!