使用具有一个写入位置的Xamarin.Forms连接到Cosmos DB

时间:2018-07-16 17:39:57

标签: xamarin xamarin.forms xamarin.ios azure-cosmosdb

从Xamarin.Forms iOS应用程序连接到Cosmos DB数据库时遇到问题。我位于加拿大西部,我正在测试当世界各地的用户使用我的应用程序时会发生什么。我原来的数据库位于美国西部数据中心,使用该位置时我可以毫无问题地登录我的应用程序。我添加了France(中央)作为读取位置,并进行了手动故障转移以使其也成为主要写入位置。现在,当我在iOS上登录我的应用程序时,它崩溃了(有时是在连接到数据库之后,有时是在连接时)。这仅在物理设备上发生,模拟器似乎可以正常运行,在Android设备上的安装也可以正常运行。

我还对所有方法调用进行了异常处理,但是没有处理异常,而是使应用崩溃了。

我正在使用Microsoft.Azure.DocumentDB.Core Nuget软件包的1.9.1版本。我尝试升级到2.0.0预览版,但这没有帮助。我还创建了一个新的数据库,并发出了使用多主机预览功能的请求,以便可以测试是否有多个写主机,看看是否可以解决问题。

在将符号加载到App Center时遇到了一些问题,但这是到目前为止我在崩溃中所能找到的:

  1. libsystem_kernel.dylib __pthread_kill
  2. libsystem_c.dylib中止
  3. Forms.Mobile.iOS log_callback(char const *,char const *,char const *,int,void *)runtime.m:1211
  4. Forms.Mobile.iOS monoeg_g_logv goutput.c:115
  5. Forms.Mobile.iOS monoeg_assertion_message goutput.c:135
  6. Forms.Mobile.iOS get_this_async_id debugger-agent.c:4831
  7. Forms.Mobile.iOS ss_start调试器-agent.c:5709
  8. Forms.Mobile.iOS process_breakpoint debugger-agent.c:5097
  9. Forms.Mobile.iOS debugger_agent_breakpoint_from_context debugger-agent.c:5465
  10. Forms.Mobile.iOS sdb_breakpoint_trampoline
  11. Forms.Mobile.iOS Forms_Mobile_ViewModels_LoginViewModel__Verifyd__64_MoveNext(c:\ code \ Forms \ Forms.Mobile \ Forms.Mobile \ Forms.Mobile \ ViewModels \ LoginViewModel.cs:228)
  12. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncMethodBuilderCore_MoveNextRunner_InvokeMoveNext_object
  13. Forms.Mobile.iOS System_Threading_ExecutionContext_RunInternal_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool
  14. Forms.Mobile.iOS System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool
  15. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncMethodBuilderCore_MoveNextRunner_Run
  16. Forms.Mobile.iOS System_Threading_Tasks_AwaitTaskContinuation_InvokeAction_object
  17. Forms.Mobile.iOS System_Threading_Tasks_AwaitTaskContinuation_RunCallback_System_Threading_ContextCallback_object_System_Threading_Tasks_Task _
  18. Forms.Mobile.iOS System_Threading_Tasks_SynchronizationContextAwaitTaskContinuation_Run_System_Threading_Tasks_Task_bool
  19. Forms.Mobile.iOS System_Threading_Tasks_Task_FinishContinuations
  20. Forms.Mobile.iOS System_Threading_Tasks_Task_FinishStageThree
  21. Forms.Mobile.iOS System_Threading_Tasks_Task_1_System_Threading_Tasks_VoidTaskResult_TrySetResult_System_Threading_Tasks_VoidTaskResult
  22. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncTaskMethodBuilder_1_System_Threading_Tasks_VoidTaskResult_SetResult_System_Threading_Tasks_VoidTaskResult
  23. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncTaskMethodBuilder_1_System_Threading_Tasks_VoidTaskResult_SetResult_System_Threading_Tasks_Task_1_System_Threading_Tasks_VoidTaskResult
  24. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncTaskMethodBuilder_SetResult
  25. Forms.Mobile.iOS Forms_Common_Services_DbService__Connectd__17_MoveNext(c:\ code \ Forms \ Forms.Formon.Services \ DbService.cs:108)
  26. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncMethodBuilderCore_MoveNextRunner_InvokeMoveNext_object
  27. Forms.Mobile.iOS System_Threading_ExecutionContext_RunInternal_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool
  28. Forms.Mobile.iOS System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool
  29. Forms.Mobile.iOS System_Runtime_CompilerServices_AsyncMethodBuilderCore_MoveNextRunner_Run
  30. Forms.Mobile.iOS System_Threading_Tasks_SynchronizationContextAwaitTaskContinuation__c ___ cctorb__7_0_object
  31. Forms.Mobile.iOS UIKitSynchronizationContext.cs:24
  32. Forms.Mobile.iOS NSAction.cs:125
  33. Forms.Mobile.iOS wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
  34. Forms.Mobile.iOS mono_jit_runtime_invoke mini-runtime.c:2782
  35. Forms.Mobile.iOS mono_runtime_invoke_checked object.c:2887
  36. Forms.Mobile.iOS mono_runtime_invoke object.c:2941
  37. Forms.Mobile.iOS native_to_managed_trampoline_3(objc_object *,objc_selector *,_MonoMethod **,unsigned int)注册器.m:100
  38. Forms.Mobile.iOS-[__ MonoMac_NSAsyncActionDispatcher xamarinApplySelector] registrar.m:11088
  39. 基金会__NSThreadPerformPerform
  40. CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
  41. CoreFoundation __CFRunLoopDoSource0
  42. CoreFoundation __CFRunLoopDoSources0
  43. CoreFoundation __CFRunLoopRun
  44. CoreFoundation CFRunLoopRunSpecific
  45. GraphicsServices GSEventRunModal
  46. UIKit UIApplicationMain
  47. Forms.Mobile.iOS wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string ___ intptr_intptr
  48. Forms.Mobile.iOS UIApplication.cs:79
  49. Forms.Mobile.iOS UIApplication.cs:63
  50. Forms.Mobile.iOS Forms_Mobile_iOS_Application_Main_string__(c:\ code \ Forms \ Forms.Mobile \ Forms.Mobile \ Forms.Mobile.iOS \ Main.cs:17)
  51. Forms.Mobile.iOS wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
  52. Forms.Mobile.iOS mono_jit_runtime_invoke mini-runtime.c:2782
  53. Forms.Mobile.iOS mono_runtime_invoke_checked object.c:2887
  54. Forms.Mobile.iOS mono_runtime_exec_main_checked object.c:4784
  55. Forms.Mobile.iOS mono_jit_exec驱动程序.g.c:1210
  56. Forms.Mobile.iOS xamarin_main monotouch-main.m:485
  57. Forms.Mobile.iOS main main.m:228
  58. libdyld.dylib开始

感谢您提供的任何帮助或建议, 格雷格

0 个答案:

没有答案