jeff
jeff

Reputation: 3327

serializing and deserializing .net 4.0 ExpandoObject

I get the error:

System.InvalidCastException : Unable to cast object of type 'System.Dynamic.ExpandoObject' to type 'System.Collections.IDictionary'.

Normally, I'd derive ExpandoObject and then put an attribute on the derived class to indicate the custom TypeConverter that I write. I don't know how else to register a TypeConverter for a type. ExpandoObject is sealed though.

The one thread on the codeplex project had a patch to the distribution. I'd rather maybe derive from JsonConverter, although, i haven't done that yet.

So before I go off in a direction, is there a suggested approach here?

Upvotes: 4

Views: 2896

Answers (1)

Brannon
Brannon

Reputation: 5414

ExpandoObjectConverter was added to Json.NET (formerly Newtonsoft) in what appears to be March 2011.

Upvotes: 1

Related Questions