title: Deserializing type from xml inheriting/implementing List/ICollection/e.t.c
body: <p>I has such hierarchy of classes, which i want to deserialize from XML. This hierarchy will be extended with &quot;OrCondition:ConditionToWork&quot;, e.t.c.. So solution must be extensible</p>
  <pre><code>public abstract class ConditionToWork { }
  
  [XmlType(nameof(WorkerMethodCondition))]
  public class WorkerMethodCondition : ConditionToWork
  {
      [XmlAttribute(nameof(WorkerMethodName))]
      public string WorkerMethodName { get; set; };
  }
  
  [XmlType(&quot;And&quot;)]
  public class AndCondition : List&lt;ConditionToWork&gt;{}
  </code></pre>
  <p>Type using these classes looks like</p>
  <pre><code>[XmlType(&quot;Worker&quot;)]
  public class Worker
  {
      [XmlArrayItem(typeof(WorkerMethodCondition))/*, XmlArrayItem(typeof(AndCondition))*/]
      public AndCondition Conditions { get; set; }
  }
  </code></pre>
  <p>And XML which i want to deserialize:</p>
  <pre><code>...
  &lt;Worker&gt;
    &lt;Conditions&gt;
      &lt;WorkerMethodCondition/&gt;
      &lt;WorkerMethodCondition/&gt;
      &lt;WorkerMethodCondition/&gt;
      &lt;And&gt;
        &lt;WorkerMethodCondition/&gt;
      &lt;/And&gt;
    &lt;/Conditions&gt;
  &lt;/Worker&gt;
  ...
  </code></pre>
  <p>With commented code it works nicely except &quot;And&quot; nodes is not deserialized properly and AndCondition entity is not added to Worker.Conditions.
  But when uncomment XmlArrayItem(typeof(AndCondition)). I get following exception &quot;System.PlatformNotSupportedException: 'Compiling JScript/CSharp scripts is not supported'&quot;</p>
  <pre><code>at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
     at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
     at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location)
     at System.Xml.Serialization.XmlSerializer..ctor(Type type, Type[] extraTypes)
  </code></pre>
  <p>How to deserialize &quot;And&quot; nodes properly?</p>