“Operation could destablize the runtime” and DynamicMethod with value types
问题 I'm trying to generalize the following IL (from Reflector): .method private hidebysig instance void SetValue(valuetype Test.TestFixture/ValueSource& thing, string 'value') cil managed { .maxstack 8 L_0000: nop L_0001: ldarg.1 L_0002: ldarg.2 L_0003: call instance void Test.TestFixture/ValueSource::set_Value(string) L_0008: nop L_0009: ret } However, when I try and reproduce this IL with DynamicMethod: [Test] public void Test_with_DynamicMethod() { var sourceType = typeof(ValueSource);