【发布时间】:2019-01-16 14:38:16
【问题描述】:
我收到异常“System.Threading.Tasks.TaskCanceledException:任务已取消。在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess”
当我想将单个文本存储到 Azure 时。
最初它工作正常,但我在 Azure 上创建了一个新的应用服务并更新了服务 url。然后它不能正常工作。 现在我有两个应用服务并使用通用数据库和数据库服务器。
日志:
[0:] System.Threading.Tasks.TaskCanceledException:任务被取消。
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task 任务) [0x00026] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task 任务) [0x00028] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task 任务) [0x00008] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Net.Http.HttpClientHandler+<SendAsync>d__63.MoveNext () [0x00528] in <35658e59c86d40bdbb2ef0bb34b4f0c7>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] 在 :0
在 System.Net.Http.HttpClient+d__49.MoveNext () [0x000ca] 在 :0
--- 从先前抛出异常的位置结束堆栈跟踪 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task 任务) [0x0001a] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task 任务) [0x00028] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task 任务) [0x00008] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+<SendRequestAsync>d__26.MoveNext () [0x00076] in <24dbefba60fd49f4b193cdf58abf3290>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] 在 :0
在 Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+d__18.MoveNext () [0x000f0] 在 :0
--- 从先前抛出异常的位置结束堆栈跟踪 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task 任务) [0x0001a] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task 任务) [0x00028] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task 任务) [0x00008] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable+<>c__DisplayClass23_0+<<InsertAsync>b__0>d.MoveNext () [0x000c1] in <24dbefba60fd49f4b193cdf58abf3290>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] 在 :0
在 Microsoft.WindowsAzure.MobileServices.MobileServiceTable+d__43.MoveNext () [0x0007f] 在 :0
--- 从先前抛出异常的位置结束堆栈跟踪 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task 任务) [0x0001a] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task 任务) [0x00028] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task 任务) [0x00008] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable+<InsertAsync>d__23.MoveNext () [0x0011f] in <24dbefba60fd49f4b193cdf58abf3290>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] 在 :0
在 Microsoft.WindowsAzure.MobileServices.MobileServiceTable1+<TransformHttpException>d__31[T].MoveNext () [0x00066] in <24dbefba60fd49f4b193cdf58abf3290>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] 在 :0
在 Microsoft.WindowsAzure.MobileServices.MobileServiceTable1+<InsertAsync>d__6[T].MoveNext () [0x000f1] in <24dbefba60fd49f4b193cdf58abf3290>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
at Microsoft.WindowsAzure.MobileServices.MobileServiceTable1+d__5[T].MoveNext () [0x00069] 在 :0
--- 从先前抛出异常的位置结束堆栈跟踪 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task 任务) [0x0001a] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task 任务) [0x00028] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task 任务) [0x00008] 在 :0
在 System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] 在 :0
在 c:\users\parmendra\documents\visual studio 2015\Projects\App4\App4\App4\TodoItemManager.cs:102 中的 App4.TodoItemManager+d__13.MoveNext () [0x00058]
线程完成:#18
【问题讨论】:
-
它是否曾与 azure 中的数据库一起使用,或者仅对本地数据库有效?如果有的话,还要添加堆栈跟踪,以便对错误有更多的了解。
-
是只实现 Azure db
-
检查 azure db 中是否有可用的目标表,检查 azure 防火墙是否允许您正在测试的机器的 IP 地址。
-
你是在本地运行还是在 Azure 上运行?如果可能,请添加演示代码并添加出错的行。同样正如 Aravind 提到的,请检查防火墙设置。
标签: azure xamarin.forms