I wonder if there is a tool like sgen for protobuf-net…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I haven’t finished the tooling in that area, but note that RuntimeTypeModel has a Compile() method that takes a path and type name; this is the method you want. I suggest trying this from a “full” .NET console application
to generate the ell then reference that from SL (also referencing the SL build of the protobuf-net dll).
You might get an IDE warning about the reference, but from memory it should work. Long term I suspect I need to switch to the IKVM emit (to explicitly target SL), and either way I need to build an exe to do this for you automatically (presumably using some pattern to find a method to generate your RuntimeTypeModel through code).
Once you have that reference you can use the model you named when generating it;
newthis up and away you go.Note that when using this approach, you can’t serialize against private members – the runtime will not allow it.