title: Can an internal setter of a property be serialized?
body: <p>Is there any way to serialize a property with an internal setter in C#?<br>
  I understand that this might be problematic - but if there is a way - I would like to know.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>[Serializable]
  public class Person
  {
      public int ID { get; internal set; }
      public string Name { get; set; }
      public int Age { get; set; }
  }
  </code></pre>
  
  <p><strong>Code that serializes an instance of the class <em>Person</em>:</strong></p>
  
  <pre><code>Person person = new Person();
  person.Age = 27;
  person.Name = "Patrik";
  person.ID = 1;
  
  XmlSerializer serializer = new XmlSerializer(typeof(Person));
  TextWriter writer = new StreamWriter(@"c:\test.xml");
  serializer.Serialize(writer, person);
  writer.Close();
  </code></pre>
  
  <p><strong>Result (missing the ID property):</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;Name&gt;Patrik&lt;/Name&gt;
    &lt;Age&gt;27&lt;/Age&gt;
  &lt;/Person&gt;
  </code></pre>