title: .NETCore XmlSerializer error
body: <p>I have an application runnin .NETFramework 4.6.1, using xml serialization for abstract classes and inherited types, with approach almost identical to this <a href="https://stackoverflow.com/questions/20084/xml-serialization-and-inherited-types">XML Serialization and Inherited Types</a>, and it works great. But after porting application to UWP .NETCore I've encountered a strange exception. Here is a simple example to reproduce it.</p>
  
  <pre><code>public class ClassToSerialize
  {
      [XmlElement(Type = typeof(CustomSerializer&lt;AnotherOne&gt;))]
      public AnotherOne anotherOne;
  
      public ClassToSerialize()
      {
      }
  }
  
  public abstract class AnotherOne
  {
      public AnotherOne()
      {
      }
  }
  
  public class CustomSerializer&lt;TType&gt; : IXmlSerializable
  {
      public CustomSerializer()
      {
      }
  
      public CustomSerializer(TType data)
      {
          m_data = data;
      }
  
      public static implicit operator CustomSerializer&lt;TType&gt;(TType data)
      {
          return data == null ? null : new CustomSerializer&lt;TType&gt;(data);
      }
  
      public static implicit operator TType(CustomSerializer&lt;TType&gt; obj)
      {
          return obj.m_data;
      }
  
      private TType m_data;
  
      public XmlSchema GetSchema()
      {
          return null;
      }
  
      public void ReadXml(XmlReader reader)
      {
      }
  
      public void WriteXml(XmlWriter writer)
      {
      }
  }
  </code></pre>
  
  <p>And creating XmlSerializer for this type</p>
  
  <pre><code>XmlSerializer sr = new XmlSerializer(typeof(ClassToSerialize));
  </code></pre>
  
  <p>causes exception</p>
  
  <blockquote>
    <p>System.InvalidOperationException: TestApp.AnotherOne, TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null is not assignable from TestApp.CustomSerializer`1[[TestApp.AnotherOne, TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.</p>
  </blockquote>
  
  <p>Same code works in .netframework app. Did they changed something in .netcore or am i missing something?</p>