Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Inserting an object into a DynamicMethod MSIL body without altering its signature

$
0
0

Thanks to some amount of masochism, I find myself trying to make a DynamicMethod that will bind to a delegate. The signature of the delegate can vary so the reaction to it can change--hence the DynamicMethod. What I intend to do is put all the arguments for whatever delegate I'm wrapping into an object array so I can pass it to an instance of a common helper method.

I've only been able to pass the object instance as a parameter. That screws up the method signature so that I can no longer bind to the delegate. I'm wondering how I can get around this. Do I have to instead, say, generate an entire class that will accept the helper and expose a dynamically-generated method to match the delegate? I'm not even sure how to do that much yet.


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>