I have a new problem. My code is:
.method public static void Main() cil managed
{
.entrypoint
.maxstack 1
IL_0000: ldnull
IL_0001: stloc.0
IL_0002: ret
}
C # code:
il.Emit(OpCodes.Ldnull);
il.Emit(OpCodes.Stloc_0);
il.Emit(OpCodes.Ret);
I generate this code through the System.Reflection and System.Reflection.Emit classes. Does anyone know why this is not possible? Please, help.

One small question - should I generate a constructor?
source
share