ForceClient.DescribeAsync无法反序列化对象

时间:2019-06-04 12:05:00

标签: salesforce sitecore

我们正在使用DeveloperForce.Force 1.3.2Newtsoft 10.0.2软件包从Salesforce获取详细信息。在DescribeAsync对象上调用ForceClient方法时会引发异常。

我们尝试通过将DeveloperForce.Force nuget从1.3.2升级到2.0.7,将Newtsoft10.0.2升级到11.0.2的问题,但问题未解决

using (var client = await SalesforceService.GetUserNamePasswordForceClientAsync())
                {
                    JObject jsonString = await client.DescribeAsync<JObject>(obj);
}

错误消息-

Cannot create and populate list type Newtonsoft.Json.Linq.JToken

StackTrace-

at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewList(JsonReader reader, JsonArrayContract contract, Boolean& createdFromNonDefaultCreator)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Salesforce.Common.ServiceHttpClient.<HttpGetAsync>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

0 个答案:

没有答案