TypeBuilder.CreateType() error

  • Thread starter Thread starter Douglas Harber
  • Start date Start date
D

Douglas Harber

I'm attempting to create a type with Reflection.Emit that is a subtype of an
already defined type. If I just declare the class as derived from the base
type and execute CreateType() it works fine. But if I add a method,
CreateType() throws a TypeLoadException with the message "The signature is
incorrect."

What should I be looking for that causes this error? I believe that the IL
generated for the method is correct (I essentially copied it from a
disassembled function generated by the compiler).

I'm kind of stumped as to what's going wrong.

Anyone have any suggestions or thoughts?

Thanks,
Doug Harber
 
I don't know but I would be using CodeDom rather than Refelection.Emit - it
is MUCH easier to work with.
 
Back
Top