title: In C#, How can I serialize Queue<>? (.Net 2.0)
body: <p>At the XmlSerializer constructor line the below causes an InvalidOperationException which also complains about not having a default accesor implemented for the generic type.</p>
  
  <pre><code>Queue&lt;MyData&gt; myDataQueue = new Queue&lt;MyData&gt;();
  
  // Populate the queue here
  
  
  XmlSerializer mySerializer =
    new XmlSerializer(myDataQueue.GetType());    
  
  StreamWriter myWriter = new StreamWriter("myData.xml");
  mySerializer.Serialize(myWriter, myDataQueue);
  myWriter.Close();
  </code></pre>