The problem is that anonymous types are defined by the compiler as inner classes. JSON.NET relies on reflection in work, and in Silverlight reflection on assembly boundaries works only for public types (when using partially trusted assemblies such as this one).
I think the DataContractJsonSerializer, as mentioned in the previous answer, is the way to go in this case, since it is part of the structure and should have additional privileges.
Another thing to try is to use dictionaries or ExpandoObject instead of anonymous types, but YMMV.
Stefan dragnev
source share