title: Is there a way to deserialize an unknown object with a DescriptorProto?
body: <p>I want to find a way to deserialize an unknown object with a DescriptorProto. When I serialize a <em>Person</em>, it's not a problem because I know its type. But when I deserialize, I don't know the type of object I receive so how with DescriptorProto, which define the structure of the proto, I can create an object like an ExpandObject? </p>
  
  <p>This is my class :  </p>
  
  <pre><code>    class Person
      {
          [ProtoMember(1)]
          public int Id { get; set; }
          [ProtoMember(2)]
          public string Name { get; set; }
      }
  </code></pre>
  
  <p>I create an object Person with some values, serialize it and create my .proto :</p>
  
  <pre><code>var person = new Person
  {
     Id = 12345,
     Name = "Fred"
  };
  using (var file = File.Create(@"C:\temp\protobuf\person.bin"))
  {
     Serializer.Serialize(file, person);
     file.SetLength(file.Position);
  }
  string proto = Serializer.GetProto&lt;Person&gt;();
  File.WriteAllText(@"C:\temp\protobuf\person.proto", proto);
  </code></pre>
  
  <p>After i create my FileDescriptor with this following command line :</p>
  
  <pre><code>protoc.exe person.proto --descriptor_set_out=person.pb
  </code></pre>
  
  <p>Finally i want to deserialize my <strong>person.bin</strong> with the description of <strong>person.pb</strong> like this :</p>
  
  <pre><code>byte[] payload = System.IO.File.ReadAllBytes(@"C:\temp\protobuf\person.pb");
  FileDescriptorSet fileDescriptorSet = FileDescriptorSet.ParseFrom(payload);
  FileDescriptorProto fileDescriptorProto = fileDescriptorSet.GetFile(0);
  DescriptorProto requestDescriptor = fileDescriptorProto.GetMessageType(0);
  
  /**
               requestDescriptor : 
  
              {name: "Person"
                  field {
                    name: "Id"
                    number: 1
                    label: LABEL_OPTIONAL
                    type: TYPE_INT32
                    default_value: "0"
                  }
                  field {
                    name: "Name"
                    number: 2
                    label: LABEL_OPTIONAL
                    type: TYPE_STRING
                  }
               }
  
               **/
  
  object youhou;
  using (var file = File.OpenRead(@"C:\temp\protobuf\person.bin"))
  {
      //youhou = Serializer.Deserialize&lt;Person&gt;(file);
      // I don't know **Person** so i can't do this
  }
  </code></pre>
  
  <p>At first, I wanted to create a <strong>Dictionary of string, object</strong> instead of <strong>Person</strong> but it's impossible to serialize it.</p>