title: c# Deserialization not working?
body: <p>I have a test console application, where I am trying to get serializaiton and deserialization to work to store data into an xml file. The serialize method works correctly, but the deserialization doesnt seem to be working. It does not produce any errors but it isnt loading my data from the .xml file. Anyone know why?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          ArrayList siteList = new ArrayList();
          DeserializeArray();
          siteList.Add("Test 1");
          siteList.Add("Test 2");
          foreach (var item in siteList)
          {
              Console.WriteLine(item);
          }
          SerializeArray(siteList);
          if (siteList.Contains("Test 2"))
          {
              Console.WriteLine("Test 2 exists!");
              Console.Read();
          }
      }
  
      public static void SerializeArray(ArrayList siteList)
      {
          XmlSerializer serializer = new XmlSerializer(typeof(ArrayList));
          TextWriter textWriter = new StreamWriter("SiteList.xml");
          serializer.Serialize(textWriter, siteList);
          textWriter.Close();
      }
  
      static ArrayList DeserializeArray()
      {
          XmlSerializer deserializer = new XmlSerializer(typeof(ArrayList));
          TextReader textReader = new StreamReader("SiteList.xml");
          ArrayList siteList;
          siteList = (ArrayList)deserializer.Deserialize(textReader);
          textReader.Close();
  
          return siteList;
      }
  }
  </code></pre>
  
  <p>}</p>