TypeBuilder.CreateType() error

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
 
N

Nick Hounsome

I don't know but I would be using CodeDom rather than Refelection.Emit - it
is MUCH easier to work with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top