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.
On 8 Sep 2012, at 22:34, Luke Pulverenti <luke.pulvere...@gmail.com> wrote:
> 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
> 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.
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To view this discussion on the web visit
> To post to this group, send email to email@example.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at