title: Protobuf-net object reference after deserialization not equal although AsReferenceDefault used
body: <p>I'm trying to use profobuf-net, but although it seems to support "object by reference" starting from version 2 according to documentation (I'm testing with version 2.0.0.668), I don't get it to work.</p>
  
  <p>To make the problem easy understandable, here is a short example code showing it:</p>
  
  <pre><code>private static void Test()
  {
      MainObject mainObject = new MainObject();
      TestObject testObject = new TestObject();
      ObjectByReference objectByReference = new ObjectByReference();
  
      mainObject.TestObjects.Add(testObject);
      mainObject.ObjectByReferences.Add(objectByReference);
  
      testObject.ObjectByReference = objectByReference;
  
      // Make sure the reference is the same before serialization.
      Debug.Assert(testObject.ObjectByReference == objectByReference);
  
      byte[] buf;
      using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
      {
          Serializer.Serialize(ms, mainObject);
          buf = ms.ToArray();
      }
  
      // --&gt; Deserialize.
      using (System.IO.MemoryStream ms = new System.IO.MemoryStream(buf))
      {
          mainObject = Serializer.Deserialize&lt;MainObject&gt;(ms);
      }
  
      testObject = mainObject.TestObjects[0];
      objectByReference = mainObject.ObjectByReferences[0];
  
      // Fails as now the reference suddenly is not the same anymore!
      Debug.Assert(testObject.ObjectByReference == objectByReference);
  }
  
  [ProtoContract]
  class MainObject
  {
      [ProtoMember(1)]
      public List&lt;TestObject&gt; TestObjects = new List&lt;TestObject&gt;();
  
      [ProtoMember(2)]
      public List&lt;ObjectByReference&gt; ObjectByReferences = new List&lt;ObjectByReference&gt;();
  }
  
  [ProtoContract]
  class TestObject
  {
      [ProtoMember(1)]
      public ObjectByReference ObjectByReference { get; set; }
  }
  
  [ProtoContract(AsReferenceDefault = true)]
  class ObjectByReference
  {
  }
  </code></pre>
  
  <p>As you can see I'm using the <code>AsReferenceDefault = true</code> attribute for the class <code>ObjectByReference</code>, but this seems not to have any effect:
  the test still fails in the last line of the <code>Test</code> function as the two objects are no longer reference equal after deserialization.</p>
  
  <p>Why is that the case?
  What am I doing wrong?</p>