title: Serializing Exception - Cannot be serialized because it does not have a parameterless constructor
body: <p>I'm getting an exception when initializing an <code>XMLSerializer</code> and passing it an instance of <code>Appointment</code> (from the EWS API):</p>
  
  <blockquote>
    <p>Microsoft.Exchange.WebServices.Data.Appointment cannot be serialized because it does not have a parameterless constructor.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>private static string FindAppointmentsAsXmlString(CalendarView calendar, ExchangeService serv)
  {
      FindItemsResults&lt;Appointment&gt; appointments = serv.FindAppointments(
          WellKnownFolderName.Calendar, calendar);
      List&lt;Appointment&gt; appointmentsList = appointments.ToList();
  
      var serializer = new XmlSerializer(appointmentsList.GetType());
      var writer = new StringWriter();
  
      try
      {
          serializer.Serialize(writer, appointmentsList);
          Console.WriteLine(writer.GetStringBuilder().ToString());
          Console.ReadLine();
      }
      catch (Exception ex)
      {
          Console.WriteLine(ex);
          Console.ReadLine();
      }
  
      return writer.GetStringBuilder().ToString(); 
  }
  </code></pre>