Android 当“偶数”时;试一试“接球”;与System.AggregateException一起失败
我收到上述错误:Android 当“偶数”时;试一试“接球”;与System.AggregateException一起失败,android,android-asynctask,xamarin.android,Android,Android Asynctask,Xamarin.android,我收到上述错误:System.aggregateeexception:发生了一个或多个错误。 使用以下代码行: List<tblDeviceIds> installIDs = KumulosHelper.Functions.Device.GetDeviceIDsOfUser(toUser); 如您所见,它位于异步任务中。。。但这应该不是问题,对吗?您收到AggregateException的原因是该异常源自任务内部(可能在单独的线程上运行)。要确定原因,请遍历InnerEx
System.aggregateeexception:发生了一个或多个错误。
使用以下代码行:
List<tblDeviceIds> installIDs = KumulosHelper.Functions.Device.GetDeviceIDsOfUser(toUser);
如您所见,它位于异步任务中。。。但这应该不是问题,对吗?您收到AggregateException的原因是该异常源自任务内部(可能在单独的线程上运行)。要确定原因,请遍历InnerException行 关于捕获不捕获,我的建议是:确保使用最新的代码。添加跟踪,而不是依赖断点。并查看是否从另一个线程抛出内部异常(GetDeviceIDsOfUser是否也使用异步?) 另见:
public static List<tblDeviceIds> GetDeviceIDsOfUser(string username)
{
IDictionary<string, string> myDict = new Dictionary<string, string>();
myDict.Add("username", username);
return KumulosGeneral.getTblDeviceIds("getDeviceIDsOfUser", myDict);
}
List<tblDeviceIds> installIDs = null;
try
{
installIDs = KumulosHelper.Functions.Device.GetDeviceIDsOfUser(toUser);
}
catch
{
installIDs = null;
}
await Task.Run(() =>
{
Intermediate.SendMessageToUser(toUsername, temp);
});