tonynhan / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Enum usage fails when obfuscated #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
See http://stackoverflow.com/questions/934459

I'm beeing 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
    }

Original issue reported on code.google.com by marc.gravell on 1 Jun 2009 at 11:49

GoogleCodeExporter commented 8 years ago
As per stackoverflow, cannot reproduce

Original comment by marc.gravell on 26 Jun 2009 at 7:24