title: Serializing in C# not serializing a List when there is a DataTable on the side?
body: <p>Here's my code:</p>
  
  <pre><code>[Serializable()]
  public class Project
  {
      private List&lt;string&gt; _Kinds = new List&lt;string&gt;();
      public DataTable ExtractedElementsTable;
  
      public Project()
      {
          ExtractedElementsTable = new DataTable();
          ExtractedElementsTable.TableName = "Output";
      }
  
      public List&lt;string&gt; Kinds
      {
          get { return _Kinds; }
          set { _Kinds = value; }
      }
  }
  </code></pre>
  
  <p>When, after adding some stuff to the <code>List&lt;string&gt; _Kinds</code>, I try to serialize the whole <code>Poject</code>, and then deserialize it, the <code>_Kinds</code> list is empty. But if I comment out all the three lines where <code>ExtractedElementsTable</code> is referenced, it works ok. Here's is my serializing and deserializing code (note the <code>currentProject.Kinds.Add("hi");</code> line in the serializing code. <code>currentProject</code> is just an instance of Project.</p>
  
  <pre><code>    private void openButton_Click(object sender, EventArgs e)
      {
          if (openFileDialog1.ShowDialog() == DialogResult.OK)
          {
              Stream stream = File.Open(openFileDialog1.FileName, FileMode.Open);
              XmlSerializer xmlFormatter = new XmlSerializer(currentProject.GetType());
              currentProject = (Project)xmlFormatter.Deserialize(stream);
              stream.Close();
          }
      }
  
      private void saveButton_Click(object sender, EventArgs e)
      {
          if (saveFileDialog1.ShowDialog() == DialogResult.OK)
          {
              currentProject.Kinds.Add("hi");
              Stream stream = File.Open(saveFileDialog1.FileName, FileMode.Create);
              XmlSerializer xmlFormatter = new XmlSerializer(currentProject.GetType());
              xmlFormatter.Serialize(stream, currentProject);
              stream.Close();
          }
      }
  </code></pre>