G
Guest
I have some code to override a property using Reflection Emit:
Zipped example:
http://homepage.ntlworld.com/ricbrown/OverridePropertyWithReflectionEmit.zip
Code: http://homepage.ntlworld.com/ricbrown/Runner.cs.html
However the emitted class does not behave the same way as a class compiled
using the regular csc compiler (.Net 2.0).
The example has a class (SimpleClass) with a single property
(SimpleProperty), and a single sub-class of it (SimpleSubClass) that
overrides the property.
The problem is that when accessing the emitted class using reflection it
throws an 'AmbiguousMatchException'. (line 87 of the example code)
Does anyone have a working example of overriding a property using Reflection
Emit?
Or can anyone point me in the right direction as to how to do this correctly?
I would be grateful for any help.
Thanks,
Richard
Zipped example:
http://homepage.ntlworld.com/ricbrown/OverridePropertyWithReflectionEmit.zip
Code: http://homepage.ntlworld.com/ricbrown/Runner.cs.html
However the emitted class does not behave the same way as a class compiled
using the regular csc compiler (.Net 2.0).
The example has a class (SimpleClass) with a single property
(SimpleProperty), and a single sub-class of it (SimpleSubClass) that
overrides the property.
The problem is that when accessing the emitted class using reflection it
throws an 'AmbiguousMatchException'. (line 87 of the example code)
Does anyone have a working example of overriding a property using Reflection
Emit?
Or can anyone point me in the right direction as to how to do this correctly?
I would be grateful for any help.
Thanks,
Richard