4

I would like to use Protocol Buffers in a Xamarin app, so I need to use a PCL project to house my non-platform-specific code.

I used the protobuf-net protogen to convert a .proto file into a .cs file, but it was incompatible with PCL projects. Making it compatible was as easy as removing every global::System.Serializable attribute from the file, but I'd like to know if there is a way to make the protogen not put those attributes in the generated file.

This would be very helpful if I were to a) find a way to automatically build .proto classes, b) change some of the very many message types on a regular basis, or c) hand over the project to someone who doesn't understand the problem.

John Brink
  • 546
  • 2
  • 8
  • 23

1 Answers1

5

Yes, the protogen tool has options to emit that. Try adding -p:lightFramework to enable this. -p:help should show the other options provided by the chosen language plugin.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900