enumeration error

Oct 18, 2011 at 12:10 AM

i'm using the latest JSON.net. and i'm trying to deserialize some json into an enumeration:

geometryType: "esriGeometryPolygon"

i have this enumeration:

/// <summary>
/// The geometry type.
/// </summary>
[DataContract]
public enum GeometryType
{
   
/// <summary>
   
/// Refers to geometry type Envelope
   
/// </summary>
   
[EnumMember(Value = "esriGeometryEnvelope")]
   
Envelope,
   
/// <summary>
   
/// Refers to geometry type MultiPoint
   
/// </summary>
   
[EnumMember(Value = "esriGeometryMultipoint")]
   
MultiPoint,
   
/// <summary>
   
/// Refers to geometry type MapPoint
   
/// </summary>
   
[EnumMember(Value = "esriGeometryPoint")]
   
Point,
   
/// <summary>
   
/// Refers to geometry type Polygon
   
/// </summary>
   
[EnumMember(Value = "esriGeometryPolygon")]
   
Polygon,
   
/// <summary>
   
/// Refers to geometry type Polyline
   
/// </summary>
   
[EnumMember(Value = "esriGeometryPolyline")]
   
Polyline
}

but it throws an error saying "Error converting value "esriGeometryPolygon" to type '...GeometryType'.

what am i missing here?