title: C# .net protocol buffers - protobuf-net support for serializing dictionary of object values?
body: <p>i'm new to protocol buffers and I am using protobuf-net for VS2010.  from what i'm reading here <a href="https://stackoverflow.com/questions/4194845/dictionary-in-protocol-buffers">Dictionary in protocol buffers</a>, it doesn't seem that protobuf can serialize a dictionary with object types as values. but here on his site i read this:</p>
  
  <blockquote>
    <p>Notes on types</p>
    
    <p>supported:</p>
    
    <p>custom classes that: are marked as data-contract have a parameterless
    constructor for Silverlight: are public many common primitives etc
    single dimension arrays: T[] List / IList
    Dictionary / IDictionary any type which
    implements IEnumerable and has an Add(T) method The code assumes
    that types will be mutable around the elected members. Accordingly,
    custom structs are not supported, since they should be immutable.</p>
  </blockquote>
  
  <p>which seems like it is supported.</p>
  
  <p>I can successfully compile a List of objects like so:</p>
  
  <pre><code>message ValuesObject {
      optional int32 SomeVal = 1;
      repeated SomeClass ListOfSomeClassTypes = 2;
  }
  </code></pre>
  
  <p>This works fine for a <code>List&lt;SomeClass&gt;</code>.  Why cannot I serialize using protobuf-net a <code>Dictionary&lt;int, SomeClass&gt;</code>? What would the message look like to serialize a <code>Dictionary&lt;int, SomeClass&gt;</code>?</p>