title: How to serialize a non List<T> collection in protobuf-net?
body: <p>Observe the following code:</p>
  
  <pre><code>[ProtoContract]
  public class C
  {
    [ProtoMember(1)]
    public IList&lt;string&gt; Tags { get; set; }
  }
  
  class Program
  {
    static void Main()
    {
      var m = RuntimeTypeModel.Default;
      m.AutoCompile = true;
      m.Add(typeof(IList&lt;string&gt;), false).AddSubType(1, typeof(ObservableCollection&lt;int&gt;));
  
      var c = new C { Tags = new ObservableCollection&lt;string&gt; { "hello" } };
      using (var ms = new MemoryStream())
      {
        Serializer.Serialize(ms, c);
        ms.Position = 0;
        var c2 = Serializer.Deserialize&lt;C&gt;(ms);
        Debug.Assert(c.Tags.Count == c2.Tags.Count);
        Debug.Assert(c.Tags.GetType() == c2.Tags.GetType());
      }
    }
  }
  </code></pre>
  
  <p>The last assertion fails, because c2.Tags is a regular <code>List&lt;T&gt;</code>, rather than <code>ObservableCollection&lt;T&gt;</code>. In effect, the AddSubType statement is ignored.</p>
  
  <p>Is it possible to fix it without using surrogates?</p>