Make PCL-friendly C # classes with protobuff network generator

I would like to use protocol buffers in a Xamarin application, so I need to use a PCL project to host my non-platform code.

I used protobuf-net protogen to convert the .proto file to a .cs file, but it was not compatible with PCL projects. Making it compatible was as simple as removing every global attribute :: System.Serializable from the file, but I would like to know if there is a way to force the protogen to not put these attributes in the generated file.

It would be very useful if I were: a) to find a way to automatically create .proto classes, b) to regularly change some of the very many types of messages, or c) to transfer the project to someone who does not. I do not understand the problem.

+4
source share
1 answer

Yes, a protogenic tool has the ability to emit it. Try adding -p:lightFrameworkto enable this. -p:helpshould show other parameters provided by the plugin of the selected language.

+5
source

Source: https://habr.com/ru/post/1546612/


All Articles