title: Can I deserialize to a read-only property of an interface in protobuf-net?
body: <p>I've got an interface and an implementation, both with [ProtoContract]. There is one property, which is read-only on the interface. When I try to deserialize a property declared as the interface, Protobuf gives me this error:</p>
  
  <p><code>System.InvalidOperationException: Cannot apply changes to property IFoo.Id</code></p>
  
  <p>Here's the code I'm testing with:</p>
  
  <pre><code>    public void Main()
      {
          using (var ms = new MemoryStream())
          {
              var x = new HasFoo {TheFoo = new Foo(1)};
  
              Serializer.Serialize(ms, x);
              ms.Position = 0;
              var clone = Serializer.Deserialize&lt;HasFoo&gt;(ms);
  
              Assert.AreEqual(1, clone.TheFoo.Id);
          }
      }
  
  
      [ProtoContract, ProtoInclude(100, typeof(Foo))]
      public interface IFoo
      {
          [ProtoMember(1)]
          long Id { get; }
      }
  
      [ProtoContract]
      public class Foo : IFoo
      {
          [ProtoMember(1)]
          public long Id { get; private set; }
  
          public Foo() { }
  
          public Foo(long id)
          {
              Id = id;
          }
      }
  
      [ProtoContract]
      public class HasFoo
      {
          [ProtoMember(1)]
          public IFoo TheFoo { get; set; }
      }
  </code></pre>
  
  <p>I'd rather not declare a setter on the interface, and I'd like to keep the <code>TheFoo</code> property declared as <code>IFoo</code> if at all possible. Is there any way that can be made to work? I'm using protobuf-net v2.</p>