Create DynamicMethod to assign value to a property?
问题 This is a learning exercise. I created a method that takes a Foo and a string and sets the A property. I used the Reflector disassembly to make the following emit code. The disassembly looks like this: .method private hidebysig static void Spork(class ConsoleTesting.Foo f, string 'value') cil managed { .maxstack 8 L_0000: ldarg.0 L_0001: ldarg.1 L_0002: callvirt instance void ConsoleTesting.Foo::set_A(string) L_0007: ret } Ok, so I modeled my emit code after that: using System; using System