tonynhan / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

MissingMethodException on CF35 for complex models #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See thread 
http://groups.google.com/group/protobuf/browse_thread/thread/50955cedea6ada
62#

Waiting on sample

Original issue reported on code.google.com by marc.gravell on 16 Mar 2009 at 10:06

GoogleCodeExporter commented 9 years ago
Can reproduce with sample file. Investigating.

Original comment by marc.gravell on 17 Mar 2009 at 8:24

GoogleCodeExporter commented 9 years ago
I want to vote for this problem. I am also experiencing this issue. It occurs 
when
the class hierarchy is above 40-50 inherited classes. The stack trace is like 
this:
  ProtoBuf.Property.PropertyFactory.Create[T](MemberInfo member)
  ProtoBuf.Serializer.Build(1)
  ProtoBuf.Serializer.Serialize[T](Stream destination, BooleanValue instance)

I have also seen the exception with this 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(AbstractValue instance,
SerializationContext destination)
 at ProtoBuf.SerializerItemProxy`2.Serialize(DateTimeValue instance,
SerializationContext destination)
 at ProtoBuf.SerializerProxy`1.Serialize(DateTimeValue instance, Stream destination)
 at ProtoBuf.Serializer.Serialize[T](Stream destination, DateTimeValue instance)

The only way to resolve the issue is by excluding members from the inheritance
hierarchy through compiler preprocessor directives.

The error never happens on the desktop framework, only on the compact framework.

Original comment by wallm...@gmail.com on 2 Dec 2009 at 3:32

GoogleCodeExporter commented 9 years ago

Original comment by marc.gravell on 22 Apr 2010 at 9:18

GoogleCodeExporter commented 9 years ago
I was just wondering if there is a release that has this fixed in it.  I 
believe I am running the latest version and I get this intermittently.  

Thanks for any information you can pass along. 

Original comment by adond...@gmail.com on 21 Jan 2011 at 4:46

GoogleCodeExporter commented 9 years ago
This is a problem with too much generics (internal to protobuf-net). In "v2", 
the entire core has been re-written with this is mind, and it should be far 
happier on CF (and faster, thanks to full pre-generation of dlls).

Note that this is *NOT* yet fully tested, but you are more than welcome to play 
with the "trunk" - note also that the build scripts are not fully tidied at the 
moment.

Marc

Original comment by marc.gravell on 21 Jan 2011 at 7:47

GoogleCodeExporter commented 9 years ago
Marc,

I'm another developer working with adondero above. We're not really wanting to 
move to v2 until it is released. Do you know of any work-arounds to this? We 
only seem to get the problem after some certain number of saved objects has 
been reached (within a single run of the application.) Is there any way to 
"clean up" the Serializer class? Would dynamically loading and unloading the 
protobuf dll make a difference? Any other suggestions?

Thank you,

Steve

Original comment by sdhpub...@gmail.com on 1 Feb 2011 at 11:17

GoogleCodeExporter commented 9 years ago

Original comment by marc.gravell on 2 Nov 2011 at 9:54