Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same problem with nested generic types. The following class would throw exactly the above exception in Mono while it's working in .NET:</p> <pre><code>[Serializable] public class SerializableDictionary&lt;TKey, TValue&gt; { /// &lt;summary&gt; /// List of serializable dictionary entries. /// &lt;/summary&gt; [XmlElement("Entry")] public List&lt;KeyAndValue&lt;TKey, TValue&gt;&gt; Entries { get; set; } /// &lt;summary&gt; /// Serializable key-value pair. /// &lt;/summary&gt; [Serializable] public class KeyAndValue { /// &lt;summary&gt; /// Key that is mapped to a value. /// &lt;/summary&gt; public TKey Key { get; set; } /// &lt;summary&gt; /// Value the key is mapped to. /// &lt;/summary&gt; public TValue Value { get; set; } } } </code></pre> <p>whereas the following one works:</p> <pre><code>[Serializable] public class SerializableDictionary&lt;TKey, TValue&gt; { /// &lt;summary&gt; /// List of serializable dictionary entries. /// &lt;/summary&gt; [XmlElement("Entry")] public List&lt;KeyAndValue&lt;TKey, TValue&gt;&gt; Entries { get; set; } /// &lt;summary&gt; /// Serializable key-value pair. /// &lt;/summary&gt; [Serializable] public class KeyAndValue&lt;TKey, TValue&gt; { /// &lt;summary&gt; /// Key that is mapped to a value. /// &lt;/summary&gt; public TKey Key { get; set; } /// &lt;summary&gt; /// Value the key is mapped to. /// &lt;/summary&gt; public TValue Value { get; set; } } } </code></pre> <p>Having the nested class use its own type parameters fixed the issue for me in Mono, maybe it does for you, as well.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload