NikedLab
NikedLab

Reputation: 903

Protobuf-net on Windows Phone 8

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?

Upvotes: 1

Views: 1021

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1063393

If you use protogen -p:help it will show you the options available not just for the tool, but: for the template you are using (csharp by default). The one of particular interest here is lightFramework. So add -p:lightFramework and 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 .proto file, but that usage is supported; it also works fine "code-first".

Upvotes: 1

Related Questions