Exception in .Net CF build

51 views
Skip to first unread message

Bryan

unread,
Mar 16, 2009, 12:11:45 PM3/16/09
to Protocol Buffers
I am using the CompactFramework 3.5 version of protobuf-net and
debugging in the Arm emulator. We have an abstract Message class with
50 child classes. So our Message class has 50 ProtoInclude attributes
on it defining all direct child classes. And all public properties in
the parent and children have ProtoMember attributes.
When we first call
ProtoBuf.Serializer.SerializeWithLengthPrefix<Message>, it appears to
loop through all the child classes and referenced classes and build
some sort of serializer object. During this process, I get a
MissingMethodException when PropertyFactory.Create<T> is calling
CreateProperty<T>.

What's strange is that it works on the first 120 or so times through
Create<T>. In fact, if I reduce my classes down to around 40, my
application works. And it doesn't matter which classes I remove, just
that I get the size down some.

It is very consistent. For a particular set of classes, it always
exceptions on the same property in the same class.

I'm not sure what could cause this. It doesn't seem to be consistent
with a MissingMethodException as the DLL is loaded and working fine.
If it is helpful, I can zip it up and someone the class set.

Bryan


Mar 10, 13:53:24, Got unhandled exception, exiting:
MissingMethodException
Stack Trace:
at ProtoBuf.Property.PropertyFactory.Create[T](MemberInfo member)
at ProtoBuf.Serializer`1.Build()
at ProtoBuf.Property.PropertyMessageString`4.OnAfterInit()
at ProtoBuf.Property.Property`1.InitPrivate(Int32 tag, DataFormat
dataFormat, Boolean isOptional, MemberInfo member, Delegate getValue,
Delegate setValue, Object defaultValue)
at ProtoBuf.Property.Property`1.Init(Int32 tag, DataFormat format,
Delegate getValue, Delegate setValue, Boolean isOptional, Object
defaultValue)
at ProtoBuf.Serializer`1.Build()
at ProtoBuf.Serializer`1.SerializeChecked(Transaction instance,
SerializationContext destination)
at ProtoBuf.SerializerItemProxy`2.Serialize(Transaction instance,
SerializationContext destination)
at ProtoBuf.SerializerProxy`1.Serialize(Transaction instance,
Stream destination)
at ProtoBuf.Serializer.Serialize[T](Stream destination, Transaction
instance)
at ProtoBuf.Serializer.SerializeWithLengthPrefix[T](Stream
destination, Transaction instance, PrefixStyle style, Int32 tag)
at ProtoBuf.Serializer.SerializeWithLengthPrefix[T](Stream
destination, Transaction instance, PrefixStyle style)

Marc Gravell

unread,
Mar 16, 2009, 5:38:06 PM3/16/09
to Protocol Buffers
> If it is helpful, I can zip it up and someone the class set.

Please; if it is reproducible, could you send me a sample?

Marc Gravell (protobuf-net)
marc.g...@gmail.com

Marc Gravell

unread,
Mar 16, 2009, 6:07:13 PM3/16/09
to Protocol Buffers
I have logged this on the protobuf-net site:
http://code.google.com/p/protobuf-net/issues/detail?id=50

Marc Gravell

Marc Gravell

unread,
Mar 17, 2009, 5:02:56 PM3/17/09
to Protocol Buffers
For the list's benefit: thanks to the excellent sample sent by Bryan,
I have been able to investigate this. Sadly, it looks like it is
hitting an internal limitation of the CF VM:

http://marcgravell.blogspot.com/2009/03/compact-framework-woes-revisted.html

I will look at re-factoring the code to side-step the limitation, but
it won't be a 2-minute fix...

Marc
Reply all
Reply to author
Forward
0 new messages