title: User settings XML serialization of an Object
body: <p>I am trying to save a custom object as a user setting in a VB.net app. This object consists of a List(Of Pair(Of String, Object)). Pair is a custom class which has two read/write properties (a String and an Object).</p>
  
  <p>If I put simple types like int, string, datetime as the second value of my pair, the setting is saved without any problem. But if I try to put something more complex, like a list, there seems to be a problem during serialization and my setting is not saved.</p>
  
  <p>String values in my pairs are serialized like this:</p>
  
  <pre><code>&lt;value1&gt;Priority_1&lt;/value1&gt;
  </code></pre>
  
  <p>Object values are serialized with a special attribute:</p>
  
  <pre><code>&lt;value2 xsi:type="xsd:int"&gt;2&lt;/value2&gt;
  </code></pre>
  
  <p>Seems like values of type Object are serialized differently, to "remember" what is the real type of the object. Why can't it do the same for more complex types like List(Of T)?</p>
  
  <p>Can you think of any simple workaround? Any tip about XML serialization that may help me is also welcome :-)</p>