【发布时间】:2017-04-08 11:39:06
【问题描述】:
我在我的 c# 应用程序中使用 JSON.net 序列化/反序列化。
当它突然在ErrorOnDeserialization 中出现以下错误时,它工作正常;
我能做些什么来解决它?
错误如下:
CurrentObject:{System.Threading.Thread}
ErrorContext:
{
Error:{"Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.Runtime.Remoting.Messaging.LogicalCallContext'."}
Member:"ExecutionContext"
Path:"Dispatcher.Thread.ExecutionContext"
}
我在下面的链接中上传了一个示例项目。请运行它并打开其中的 .flow 文件,直到它进入显示错误的断点。 enter link description here
【问题讨论】:
-
@可能是由于添加了一些引用而出现此问题。您是否添加了Newtonsoft.Json.dll引用?
-
@anisprogrammer - 嗨。是的,我正在使用 Newtonsoft.Json.dll,它已被添加到项目的参考中!
-
你能告诉我你的代码吗
-
您的 json 和您的对象不匹配。请发布您拥有的课程,示例 json 和反序列化代码
-
@anisprogrammer - 代码非常庞大!超过 25000 行。如果你能告诉我你需要哪一部分代码?
标签: c# json multithreading linq json.net