Unable to access method in dynamic assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a dynamic assembly, and I am emitting code to invoke other
members already generated in the same assembly, before the type is baked. In
order to call a method, I need a MethodInfo object for the method.
I am trying to call TypeBuilder.GetMethod in order to get the MethodInfo
object, but I get the exception
"System.NotSupportedException : The invoked member is not supported in a
dynamic module." when calling this method.
Question: Is there a way to get the MethodInfo objects from the TypeBuilder
before the type is baked?

Regards,
Kjell Tangen
 
Kjell,
Question: Is there a way to get the MethodInfo objects from the TypeBuilder
before the type is baked?

Can't you use the MethodBuilder (which derives from MethodInfo) you
used to construct the method?


Mattias
 
Certainly, my question was motivated by the desire to avoid the complexity of
managing all the MethodBuilders (and other builders) if it is possible to get
them from the TypeBuilder. I assume it is not....
Thanks anyway!

Kjell
 
Back
Top