This project has moved and is read-only. For the latest updates, please go here.


Dec 14, 2009 at 2:04 PM

GetParameters for Open Generic methods is not supported.

Stack Trace:

at System.Reflection.RuntimeMethodInfo.GetParameters()
   at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
   at Newtonsoft.Json.Utilities.ThreadSafeStore`2.AddValue(Type key)
   at Newtonsoft.Json.Utilities.ThreadSafeStore`2.Get(Type key)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.ShouldWriteReference(Object value, JsonProperty property)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value)
   at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)
   at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Formatting formatting, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.SerializeObject(Object value)
   at Wizcom.InOrderII.Sockets.Mobile.Serialize.SerializeToString[T](Order data)........


Why could this come up for no reason while everything seems to be fine, this only comes when using the CF serializer. Tested something similar for the Desktop

and seems to work. What is this error tells me?

My serializing method:

        public static string SerializeToString<T>(T data) where T : class
            return JsonConvert.SerializeObject(data);

My class i want to serialize:

    public class Order
        public int Id { set; get; }
        public DateTime OrderDate { set; get; }
        public int StationId { set; get; }
        public string OrderIdentifier { set; get; }
        public List<OrderLine> OrderLines = new List<OrderLine>();
Any thoughts?

Dec 14, 2009 at 9:09 PM

Get the latest version of the source code from CodePlex and build and use that. This bug has been fixed.

Dec 15, 2009 at 10:34 AM

No it is not fixed.


Dec 15, 2009 at 11:01 PM
Edited Dec 15, 2009 at 11:02 PM

Hmmm I'm not sure then. The exact same problem was fixed here -

Dec 16, 2009 at 9:42 AM

I Added 

 if (method.ContainsGenericParameters)

In DefaultContactResolver.cs at line 183 and build. This worked.


Dec 16, 2009 at 9:57 AM

Ah ok. I meant get the latest source code from the Source Code tab on CodePlex. It has that new check.

Dec 16, 2009 at 12:25 PM

I downloaded the Looks OK