I'm getting an unexpected RuntimeBinderInternalCompilerException when passing an object as a dynamic argument.
I'll try to explain the scenario, as it's too involved to paste code easily. I'm doing some really weird hackery with Roslyn, so it's going to sound odd.
- Execute application
- Monitor source code for changes
- Recompile what is effectively a diff of the assembly with the changed files/classes
- Load the new compiled assembly into the original AppDomain
- Pass existing object instances to the new/changed code as Dynamic, so the new code can operate on existing context/application state.
This dynamic passing should work, because the type is compatible: i.e., in my case I can guarantee it has functionally matching methods/types.
But when I go to execute the changed+reloaded method, and it receives an object of type dynamic, I'm getting this exception.
RuntimeBinderInternalCompilerException was unhandled.
An unexpected exception occurred while binding a dynamic operation
Per MSDN:
Exceptions of this kind differ from RuntimeBinderException in that RuntimeBinderException represents a failure to bind in the sense of a usual compiler error, whereas RuntimeBinderInternalCompilerException represents a malfunctioning of the runtime binder itself.
Google has absolutely no results for this. I don't know how to debug further into it either. Any suggestions?
( I did do some sandbox testing to assure myself that I could load different assemblies at runtime into a test application and pass instanced types from different assemblies to a single method accepting a dynamic parameter. So it does work in that scenario. )
dynamic, so you might want to post it to Connect.