<div dir="ltr">Interesting, do you have to run though all registered classes that are sub-classes of the base class and cast them checking for null?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 9:24 AM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Monday, 17 February 2014 at 06:09:35 UTC, Rory McGuire wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A base class reference is: from your example an A which actually contains a<br>
C or B.<br>
<br>
Honestly I haven't tried this I would have assumed that D still gives you<br>
the real type when using reflection but have you tried it?<br>
</blockquote>
<br></div>
Unfortunately the only why to get a value of field by reflection requires the static type to be known. When serializing through a base class reference the static type is lost. Therefore it's required to register the subclass, one way or another.<br>

<br>
--<br>
/Jacob Carlborg<br>
</blockquote></div><br></div>