title: Deserializing a different List with protobuf-net
body: <p>I have a problem with deserialization Protobuf-net. I serialize a <code>List&lt;&gt;</code> but when I deserialize the <code>List&lt;&gt;</code> returned is not identical to the first. There is missing data.
  I do not understand why.</p>
  
  <p>I initialize my <code>List&lt;&gt;</code> in ctr</p>
  
  <pre><code>public ctr()
  {
      DateTime date = new DateTime(2012 , 12, 03); ;
      LkVisiteurIdDTO visitid= new LkVisiteurIdDTO(10, 11, 12);
      PurgeDateTimeDTO datetime= new PurgeDateTimeDTO(date, true);
      ContractProtoBuf proto = new ContractProtoBuf();
  
      for (int i = 0; i &lt; 5; i++)
      {
          proto.m_Index = i + 1;
          proto.m_TechnicalKey = "m_TechnicalKey" + i;
          proto.m_LogicalKey = visitid;
          proto.m_PurgeTime = datetime;
  
          protoContractList.Add(proto);
      }
  
  }
  
  public byte[] serialization()
  {
      MemoryStream ms = new MemoryStream();
      try
      {
          Serializer.Serialize(ms, protoContractList);
          arr = ms.ToArray();
          return arr;
      }
      catch
      {
          Console.WriteLine("La sérialisation protobuf a échoué");
          return null;
      }
      finally
      {
          ms.Close();
      }
  
  }
  
  public List&lt;ContractProtoBuf&gt; deserialization()
  {
      MemoryStream ms = new MemoryStream(arr,false);
      try
      {             
          listeRetour = Serializer.Deserialize&lt;List&lt;ContractProtoBuf&gt;&gt;(ms);
          return (listeRetour);
      }
      catch (Exception e)
      {
          Console.WriteLine("La désérialisation protobuf a échoué");
          return null;
      }
      finally
      {
          ms.Close();
      }
  }
  </code></pre>
  
  <p>So my question is how to have same result ?</p>
  
  <hr>
  
  <p>Here is my structure     </p>
  
  <pre><code>    [ProtoContract]
  public struct ContractProtoBuf
  {
      [ProtoMember(1)]
      public int m_Index;
  
      [ProtoMember(2)]
      public string m_TechnicalKey;
  
      [ProtoMember(3)]
      public LkVisiteurIdDTO m_LogicalKey;
  
      [ProtoMember(4)]
      public PurgeDateTimeDTO m_PurgeTime;
   }
  </code></pre>
  
  <p>I create a list of ContractProtoBuf and I add data with values ​​"that do not have consequence."</p>
  
  <pre><code>    public ctr()
      {
  DateTime date = new DateTime(2012 , 12, 03); ;
  
  for (int i = 0; i &lt; 5; i++)
  {
      LkVisiteurIdDTO visitid= new LkVisiteurIdDTO(10, 11, 12);
      PurgeDateTimeDTO datetime= new PurgeDateTimeDTO(date, true);
      ContractProtoBuf proto = new ContractProtoBuf();
      proto.m_Index = i + 1;
      proto.m_TechnicalKey = "m_TechnicalKey" + i;
      proto.m_LogicalKey = visitid;
      proto.m_PurgeTime = datetime;
  
      protoContractList.Add(proto);
  }    
  </code></pre>
  
  <p>}       </p>
  
  <p>I serialize my list that gets a Byte [] and when I deserialize the Byte [], the return list does not contain the same values ​​in the type PurgeDateTimeDTO and LkVisiteurIdDTO .</p>
  
  <p>In the return list I find the dateTime {01/01/0001 0:00:00} and visitid {0,0,0}
  However m.Index and m_Technicalkey have good value</p>