This project has moved. For the latest updates, please go here.

Call in DynamicEmit

Topics: User Forum
Nov 26, 2006 at 10:29 PM
Please excuse me. I'm a newbie to all this Emit jazz. :)

Could you tell me if this is a bug?

public void Call(ConstructorInfo constructor)
{
_ilGen.Emit(OpCodes.NewObj, constructor);
}

I changed it to:

public void Call(ConstructorInfo constructor)
{
_ilGen.Emit(OpCodes.Call, constructor);
}

and all is good.

Regards,
Marc
Coordinator
Nov 30, 2006 at 7:36 AM
Every use I've seen uses NewObj, not Call. Is there a specific test-case that you are concerned about?

See for example: http://blogs.msdn.com/yirutang/archive/2005/04/28/413284.aspx