This project is read-only.


dynamic object to fast json -> fails


I have a issue when I try to serialize to JSON a dynamic object.
dynamic deserializedJSON_ = new ExpandoObject();
deserializedJSON_.UserView = "10080";
deserializedJSON_.UserCatalog ="test";
deserializedJSON_.UserDate = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
deserializedJSON_.UserBase = "";

string x=fastJSON.JSON.ToJSON(deserializedJSON_);

my x=[{},{},{},{}]
also the microsoft version fails:
string json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(deserializedJSON_);
I need to use dynamic cause my object can change a lot why can't fastJSON serialize a dynamic type?

Update: the error was reported for version 2.1.3; just updated to 2.1.9 and seems ExpandoObject is fully supported.

PS: thank you MGholam for your time
Closed Jul 15, 2016 at 10:47 AM by MGholam
Fixed in 2.1.17


MGholam wrote Feb 20, 2015 at 4:56 PM

ExpandoObject is not currently supported.

You can easily do :
dynamic a = new {
UserView = "10080",
UserCatalog ="test"