Exception:Error converting value 123 to type 'System.Collections.Generic.List`1[DynamicClass+MyCompletionData]'. Path '', line 1, position 3.Could not cast or convert from System.Int64 to System.Collections.Generic.List`1[DynamicClass+MyCompletionData].

报错信息

JsonSerializationException: Error converting value 123 to type 'System.Collections.Generic.List`1[DynamicClass+MyCompletionData]'. Path '', line 1, position 3.
--LineNumber: 1
--LinePosition: 3
StackTrace:
   在 Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   在 Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   在 Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   在 Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   在 Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   在 Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   在 DynamicClass.<>c__DisplayClass8.<<Exec>b__3>d__b.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

ArgumentException: Could not cast or convert from System.Int64 to System.Collections.Generic.List`1[DynamicClass+MyCompletionData].
--Message: Could not cast or convert from System.Int64 to System.Collections.Generic.List`1[DynamicClass+MyCompletionData].
StackTrace:
   在 Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
   在 Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
   在 Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)

 

解决方法

暂无解决方案。

相关信息
0 查看
2023-11-02 10:20
Quicker版本
版本 反馈次数