public static void EmitBaseCallWithDefaultArgumentValues(this MethodBody methodBody, MethodReference methodRef) { if (methodRef != null && methodRef.HasGenericParameters || methodRef.DeclaringType.HasGenericParameters) { throw new ArgumentException("Method reference must not point to a method of a non-closed gereric type.", "methodRef"); } methodBody.Instructions.Add(Instruction.Create(OpCodes.Ldarg_0)); methodBody.EmitPushDefaultArgumentValues(methodRef); methodRef = methodBody.Method.Module.Import(methodRef); methodBody.Instructions.Add(Instruction.Create(OpCodes.Call, methodRef)); }