title: XML Serializer not serializing property which has public getter but no setter
body: <p>I am wondering if I am missing anything here... My understanding is that I should be able to get the ID property (but not set it) after deserializing. As it stands, the ID property is not brought along at all:</p>
  
  <pre><code>namespace CableSolve.Orders.Core.Dto
  {
      [Serializable]
      [XmlRoot("Task"), SoapType("Task")]
      public class TaskDto : IDto
      {
          // ReSharper disable ConvertToAutoPropertyWithPrivateSetter
          private int _id;
          public int ID { get { return _id; } }
          // ReSharper restore ConvertToAutoPropertyWithPrivateSetter
          public int TaskSequence { get; set; }
  
          public TaskDto()
          {
          }
      }
  }
  </code></pre>
  
  <p>Ideally my ID would not be settable. If I give the ID property an automatic, private setter -- XML Serializer throws a fit. I thought the workaround for that was <a href="http://softwareblog.alcedo.com/post/2010/01/21/Readonly-collection-properties-and-XmlSerializer.aspx" rel="nofollow">described here</a>, but it does not appear to work for non-collections? I would prefer to not have to rewrite using DataContract at this point in time.</p>
  
  <blockquote>
    <p>'CableSolve.Web.Api.WorkflowServicesProxy.TaskDto' does not contain a definition for 'ID' and no extension method 'ID' accepting a first argument of type 'CableSolve.Web.Api.WorkflowServicesProxy.TaskDto' could be found</p>
  </blockquote>