Closed vasily-kirichenko closed 7 years ago
Interesting. I wasn't aware that DataContract applies to enumerations, which occurs through use of the EnumMember
attribute. DataContract-annotated enums will fail serialization if attempting to write a value that does not specify an EnumMember
attribute. In other words, "correct behaviour" in the context of your code would result in a serialization exception.
I must say I dislike this design, and it's a good question whether FsPickler should attempt to replicate this behaviour or just ignore the attributes altogether.
Removing
DataContract
attribute solves the problem.