title: C# XML serialization backwards compatibility
body: <p>Previously, the serialization/deserialization methods used the type <code>Item</code>:</p>
  
  <pre><code>public class Item{}
  </code></pre>
  
  <p>Now I have a new class called <code>ItemWrapper</code> derived from <code>Item</code> with an additional property:</p>
  
  <pre><code>public class ItemWrapper : Item
  {
      public string NewProperty { get; set; }
  }
  </code></pre>
  
  <p>Now my  serialization/deserialization methods use the type <code>ItemWrapper</code>. And now I've broken backwards compatibility. I cannot load any XML files of type <code>Item</code> that got saved in older versions. I've considered putting a try/catch on the deserialization method when it tries to deserialize <code>Item</code> as <code>ItemWrapper</code> and then in the catch I would then try to deserialize as <code>Item</code>. Or I could xPath to see the XML structure and if no <code>ItemWrapper</code> is found, I could assume it as <code>Item</code>. Both of these solutions feel hacky, and I'm sure there's a better approach for handling this situation. Any ideas?</p>