Hi

I am using C# 2.0. I need to use the MethodBuilder.CreateMethodBody
that takes byte[] as the input parameter taking the IL codes as byte
array. I feed this input from MethodBody.GetILAsByteArray. But when the
method created dynamically via MethodBuilder.CreateMethodBody is
invoked by TypeBuilder.Invoke, it throws exception [inner exception]
"Bad Method Token". If the body of the method [which is requested as
IL by the MethodBody.GetILAsByteArray] is empty, then the method
executes successfully.

Is there any special that has to be done with the byte [] from
MethodBody.GetILAsByteArray before giving it as input to the
MethodBuilder.CreateBody.

I could not find enough information even on the MSDN documentation
about this.

Your help is appreciated.

Thanks
Vivek Ragunathan