Home All Groups Group Topic Archive Search About

TypeBuilder.CreateType() error

Author
18 Feb 2006 3:47 AM
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

Author
18 Feb 2006 12:26 PM
Nick Hounsome
I don't know but I would be using CodeDom rather than Refelection.Emit - it
is MUCH easier to work with.

Show quote
"Douglas Harber" <--remove-this--dh-nospam@pobox.com> wrote in message
news:uyd%23I4DNGHA.208@tk2msftngp13.phx.gbl...
> 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
>
>

AddThis Social Bookmark Button