1

Closed

An unhandled exception of type 'System.InvalidCastException' occurred in CodeBetter.Json.CF.dll

description

If variable is based on enum defined as byte e.g.
 
public enum ZigBeeReceiveOptionType : byte
{
    PacketAcknowledged = 0x01,
    BroadcastPacket = 0x02
}
 
can not be cast like:
 
(ReflectionHelper.cs)
return (field.FieldType.IsEnum) ? (int) value : value;
 
  • Pawel
Closed Feb 11, 2009 at 9:45 PM by KarlSeg

comments

KarlSeg wrote Feb 11, 2009 at 9:45 PM

Thanks for the feedback. Was aware of the issue, but at the time wasn't sure how to fix it. Turns out it was pretty straightforward. I'll bundle it up for the next release, but since that's atleast a month away, you might wanna grab revision 10615 (or onwards) for the fix.

wrote Feb 11, 2009 at 9:45 PM

wrote Feb 11, 2009 at 9:45 PM

wrote Feb 14, 2013 at 12:17 AM

wrote May 16, 2013 at 4:47 AM