How to map System Enum's in Protobuf.Net
问题 I have a class which has a property of type System.IO.FileAttribute (enum) Upon serializing with protobuf-net I get the error: No wire-value is mapped to the enum System.IO.FileAttributes.Hidden, System, Archive How would I go about mapping system enum's to a Contract with Members? 回答1: That is a [Flags] enum, which doesn't really have a direct map in protobuf (as defined by google). I would simply re-expose as int : public FileAttributes Attributes {get;set;} [ProtoMember(12)] // whavever