eyan
unread,Feb 5, 2012, 7:37:12 AM2/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
Hi,
I have a Type :
Command<TData> : Base where TData : ISomething.
TData are POCOs (DataContracts).
Im using ProtoBuf.net V2, and I'm registering the types to the Modal
on run time.
I'm having 2 issues:
1) on MetaType.Add(properties names) i get ObjectReference exception
when the Type includes Generic Type property.
Unhandled Exception: System.NullReferenceException: Object reference
not set to
an instance of an object.
at ProtoBuf.Meta.TypeModel.ResolveProxies(Type type) in C:\Dev
\protobuf-net\protobuf-net\Meta\TypeModel.cs:line 952
at ProtoBuf.Meta.RuntimeTypeModel.FindWithoutAdd(Type type) in C:
\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 118
at ProtoBuf.Meta.ValueMember..ctor(RuntimeTypeModel model, Type
parentType, Int32 fieldNumber, MemberInfo member, Type memberType,
Type itemType, Type defaul
tType, DataFormat dataFormat, Object defaultValue) in C:\Dev\protobuf-
net\protobuf-net\Meta\ValueMember.cs:line 75
at ProtoBuf.Meta.MetaType.AddField(Int32 fieldNumber, String
memberName, Type itemType, Type defaultType, Object defaultValue) in C:
\Dev\protobuf-net\protobu
f-net\Meta\MetaType.cs:line 1165
at ProtoBuf.Meta.MetaType.Add(String[] memberNames) in C:\Dev
\protobuf-net\protobuf-net\Meta\MetaType.cs:line 1046
2) If I'm skipping the Open generic types and im trying to register
them at serialization :
if (this._modal.CanSerializeContractType(objectType) == false)
{
this._modal.Add(objectType, false);
this._modal.CompileInPlace();
}
I get true in CanSerializeContractType, the type is serialized/
deserialized but only the base class (default values to all others).
What is the practice to do so without adding all permutations at
design time ?
Thanks,
Eyan.