Precompiler Serialization Error

445 views
Skip to first unread message

Luke Pulverenti

unread,
Sep 8, 2012, 5:34:21 PM9/8/12
to prot...@googlegroups.com
Marc,

I have a DTO class library which I'm running your precompiler against.

When I attempt to use this to Serialize, I receive the following error:

Type=System.InvalidOperationException Msg=Type is not expected,, and no contract can be inferred: System.RuntimeType StackTrace= [n]    at ProtoBuf.Meta.TypeModel.ThrowUnexpectedType(Type type) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:line

Oddly enough, de-serialization works perfectly. I'm not sure if this matters, but the DTO library is also a portable class library. All of the entities within are tagged with ProtoContract and ProtoMember attributes.

Any ideas what the issue might be? Thanks.

Marc Gravell

unread,
Sep 8, 2012, 6:20:37 PM9/8/12
to Luke Pulverenti, prot...@googlegroups.com
This sounds very protobuf-net specific; it might be easier to take this off-group, but I think I'll need a bit more context; in particular, since it is a PCL type, what runtime is this on when erroring? Also, are you using Serializer.*, or are you creating an instance of the custom serializer created by the precompiler? And any chance of seeing the actual Serialize call? Annoyingly, my first suspicion is an internal bug, probably relating to the different overloads on the different frameworks.

Marc
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/6_LgIN2a8U0J.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
Reply all
Reply to author
Forward
0 new messages