I have a piece of IL that I want to process with Cecil that looks like this:
L_0000: ldc.i4.2 L_0001: ldc.i4.2 L_0002: newobj instance void int32[0...,0...]::.ctor(int32, int32) I can create a MethodReference from the third instruction just fine, the declaring type is int[,]. My basic problem is that I want to check whether the referenced method is a constructor or not. For this purpose I'm doing MethodReference.Resolve() and then check IsConstructor. What happens during resolution is that Cecil tries to resolve this ctor on int32 (the arrays element type), where it cannot find it. The runtime must have some kind of special handling here, and I feel Cecil should do the same but I am open to other suggestions. Regards, Johannes -- -- mono-cecil
