title: XmlSerializer.Deserialize doesn't work with the base class even with XmlInclude
body: <p>If I Serialize a derived class, I cannot Deserialize the base class even with XmlInclude attributes.  It fails with " was not expected."  If I use the same serializer instance that I used to serialize the data, it works.  If I create a new serializer (like if it was in another process), it fails.</p>
  
  <pre><code>    [Serializable]
      [XmlInclude(typeof(D))]
      public class B
      {
          public string x { get; set; }
      }
      public class D : B
      {
          public string y { get; set; }
      }
  
  ... code snippet ....
      D x = new D();
      using (MemoryStream ms = new MemoryStream())
      {
          XmlSerializer serializer = new XmlSerializer(typeof(D));
          serializer.Serialize(ms, x);
          ms.Flush();
  
          ms.Seek(0, SeekOrigin.Begin);
          string responseBuffer = Encoding.ASCII.GetString(ms.GetBuffer());
  
          ms.Seek(0, SeekOrigin.Begin);
          serializer = new XmlSerializer(typeof(B));
          B x2 = (B)serializer.Deserialize(ms);
      }
  </code></pre>
  
  <p>As I noted before, if I used the original serializer (typeof(D)) it works.  If I recreate the serializer (typeof(B)).
  Thanks in advance for your help,</p>