I'm being presented with the following Exception when trying to serialize a class that contains enums in an obfuscated project:
ProtoBuf.ProtoException: The default enum value X is not defined for the optional property Y
If I exclude all affected enums from obfuscation everything runs fine, however, I switched to protobuf.net to be able to obfuscate more code content so I hope there is a better solution.
So is it the obfuscator which messes around to much for protobuf.net or am I declaring my enums the wrong way?
I have tried:
[ProtoContract]
public enum X
{
Y, Z
}
and
[ProtoContract]
public enum X
{
Y=0, Z=1
}
also without a contract at all and several other not so obvious things but nothing except exclusion works. By the way: Is there an example somewhere what we have to do with enums when using protobuf.net?