解析JSON中指定的类型时出错

时间:2017-03-20 12:52:48

标签: c# json xml

我有一个类型为

的类
Dictionary<long, List<XmlAttribute>> 

Iam尝试使用以下代码

反序列化此数据
                    JsonSerializerSettings settings = new JsonSerializerSettings
                    {
                        TypeNameHandling = TypeNameHandling.All,
                        TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
                    };
                    scriptMarks = JsonConvert.DeserializeObject<GetScriptMarksMsg>(mq.MessageBody, settings);

但执行时显示错误

无法反序列化数据。数据可能已损坏。 ---&GT; Newtonsoft.Json.JsonSerializationException:在JSON'System.Collections.Generic.Dictionary 2[[System.Int64, mscorlib],[System.Collections.Generic.List 1 [[System.Xml.XmlAttribute,System.Xml]],mscorlib]],

中指定的错误解析类型

Newtonsoft.Json.JsonSerializationException:在程序集'mscorlib中找不到类型'System.Collections.Generic.Dictionary 2[[System.Int64, mscorlib],[System.Collections.Generic.List 1 [[System.Xml.XmlAttribute,System.Xml]],mscorlib]]', Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'。

有人对此有任何想法吗?

0 个答案:

没有答案
相关问题