I try use Google protobuf in my WP8 application. I use protobuf-net for my purpoces. When I generate my proto.cs file from qwerty.proto I see next string (below)
...
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Query") ]
...
But WP8 SDK has not Serializable in System namespace.
May be I made a mistake when I generated proto.cs via protogen.exe? May be it has any additional parameters?
If you use
protogen -p:helpit will show you the options available not just for the tool, but: for the template you are using (csharpby default). The one of particular interest here islightFramework. So add-p:lightFrameworkand you should be set.Also: for the best performance on phone 8, you may also want to look at
precompile, which allows it to use static IL rather than reflection. This is discussed more here.Note that with protobuf-net it is not required that you start from a
.protofile, but that usage is supported; it also works fine “code-first”.