Related Is it possible to call a DynamicMethod from MethodBuilder/ConstructorBuilder
I have the same problem. However I can't use the same solution (which is to emit an instance method instead of a DynamicMethod) because my DynamicMethod results in a closure. Is there a different solution than the one provided that allows me to use a closure or equivalent?
I have one idea for a solution which is to still generate a closure class and assign all variables to the closure as normal, then generate an instance method that takes in the closure class or create an instance method on the closure class itself.