I am working ona Windows CE 5.0 device with .net compact framework2.0.
I am trying to serialize this class (i'll summarize as the object is much 

public class Anag {
    public Anag() {
         persons = new Dictionary<String,Person>();
         adresses = new Dictionary<Int32, Address>;
    public Dictionary<String, Person> persons {get; set;};
    public Dictionary<Int32, Address> addresses {get; set;};

class Person {
        public int Id {get;set;}
        public string Name {get;set:}

class Address {
        public string Line1 {get;set;}
        public string Line2 {get;set;}

I load up the Anag class with data the serialize with

Anag anag = loadAnag();
FileStream fs = File.Create(fileName);
Serializer.Serialize<Anag>(fs, ana);

but i get:

System.Reflection.TargetInvocationException was unhandled
    at System.Reflection.RuntimePropertyInfo.GetValue()
    at ProtoBuf.Serializers.TupleSerializer.GetValue()
    at ProtoBuf.Serializers.TupleSerializer.Write()
    at ProtoBuf.Meta.RuntimeTypeModel.Serialize()
    at ProtoBuf.ProtoWriter.WriteObject()
    at ProtoBuf.Serializers.TagDecorator.Write()
    at ProtoBuf.Serializers.ListDecorator.Write()
    at ProtoBuf.Serializers.PropertyDecorator.Write()
    at ProtoBuf.Serializers.TypeSerializer.Write()
    at ProtoBuf.Meta.RuntimeTypeModel.Serialize()
    at ProtoBuf.Meta.TypeModel.SerializeCore()
    at ProtoBuf.Meta.TypeModel.Serialize()
    at ProtoBuf.Meta.TypeModel.Serialize()
    at ProtoBuf.Serializer.Serialize()

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to