Xamarin.android 在Android中使用mvvmcross调用Windows Azure移动服务的ToListSync()方法时出错
我正在用mvvmcross中的AzureMobile服务构建一个应用程序,当我调用ToListSync()方法从Windows Phone 8中的服务器检索数据时,它工作正常,但Xamarin.Android中有一个错误。有人建议我解决这个问题吗 这是一个完整的错误堆栈Xamarin.android 在Android中使用mvvmcross调用Windows Azure移动服务的ToListSync()方法时出错,xamarin.android,xamarin,mvvmcross,azure-mobile-services,Xamarin.android,Xamarin,Mvvmcross,Azure Mobile Services,我正在用mvvmcross中的AzureMobile服务构建一个应用程序,当我调用ToListSync()方法从Windows Phone 8中的服务器检索数据时,它工作正常,但Xamarin.Android中有一个错误。有人建议我解决这个问题吗 这是一个完整的错误堆栈 mvx:Warning: 39.64 Exception masked AggregateException: 12-02 14:06:53.317 I/mono-stdout( 2032): mvx:Warning: 39.
mvx:Warning: 39.64 Exception masked AggregateException:
12-02 14:06:53.317 I/mono-stdout( 2032): mvx:Warning: 39.64 Exception masked AggregateException:
at System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[EmployeeDirectoryCross.Core.Models.Employee]].get_Result () [0x00000] in <filename unknown>:0
12-02 14:06:53.326 I/mono-stdout( 2032): at System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[EmployeeDirectoryCross.Core.Models.Employee]].get_Result () [0x00000] in <filename unknown>:0
12-02 14:06:53.335 I/mono-stdout( 2032): at EmployeeDirectoryCross.Core.ViewModels.EmployeeListViewModel+<>c__DisplayClass2.<SearchEmployees>b__1 () [0x00001] in e:\Study\Xamarin\XamrinSamples\EmployeeDirectoryCross\EmployeeDirectoryCross.Core\ViewModels\EmployeeListViewModel.cs:54
12-02 14:06:53.335 D/Mono ( 2032): Unloading image System.dll [0x2b365118].
12-02 14:06:53.335 D/Mono ( 2032): Image addref System[0x2b354bf8] -> System.dll[0x2a6189d8]: 18
at EmployeeDirectoryCross.Core.ViewModels.EmployeeListViewModel+<>c__DisplayClass2.<SearchEmployees>b__1 () [0x00001] in e:\Study\Xamarin\XamrinSamples\EmployeeDirectoryCross\EmployeeDirectoryCross.Core\ViewModels\EmployeeListViewModel.cs:54
12-02 14:06:53.355 I/mono-stdout( 2032): at Cirrious.CrossCore.Core.MvxMainThreadDispatcher.ExceptionMaskedAction (System.Action action) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.Core.MvxMainThreadDispatcher.ExceptionMaskedAction (System.Action action) [0x00000] in <filename unknown>:0
12-02 14:06:53.355 I/mono-stdout( 2032): InnerException was MobileServiceInvalidOperationException: The server did not provide a response with the expected content.
InnerException was MobileServiceInvalidOperationException: The server did not provide a response with the expected content.
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+<SendRequestAsync>d__1c.MoveNext () [0x00000] in <filename unknown>:0
12-02 14:06:53.355 I/mono-stdout( 2032): at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+<SendRequestAsync>d__1c.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
12-02 14:06:53.355 I/mono-stdout( 2032): --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
12-02 14:06:53.365 I/mono-stdout( 2032): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
12-02 14:06:53.365 I/mono-stdout( 2032): at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0
12-02 14:06:53.385 I/mono-stdout( 2032): at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+<RequestAsync>d__4.MoveNext () [0x00000] in <filename unknown>:0
mvx:警告:39.64异常屏蔽聚合异常:
12-02 14:06:53.317 I/mono标准输出(2032):mvx:警告:39.64异常屏蔽聚合异常:
在System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[EmployeeDirectoryCross.Core.Models.Employee]]处。在以下位置获取结果()[0x00000]:0
12-02 14:06:53.326 I/mono标准输出(2032):在System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[EmployeeDirectoryCross.Core.Models.Employee]]中。在:0中获取结果()[0x00000]
12-02 14:06:53.335 I/mono标准输出(2032):在EmployeeDirectoryCross.Core.ViewModels.EmployeeListViewModel+c_u显示Class2.b_uu1()[0x00001]在e:\Study\Xamarin\XamrinSamples\EmployeeDirectoryCross\EmployeeDirectoryCross.Core\ViewModels\EmployeeListViewModels.cs:54
12-02 14:06:53.335 D/Mono(2032):正在卸载image System.dll[0x2b365118]。
12-02 14:06:53.335 D/Mono(2032):图像添加参考系统[0x2b354bf8]->System.dll[0x2a6189d8]:18
在EmployeeDirectoryCross.Core.ViewModels.EmployeeListViewModel+c__显示Class2.b_uu 1()[0x00001],在e:\Study\Xamarin\XamrinSamples\EmployeeDirectoryCross\EmployeeDirectoryCross.Core\ViewModels\EmployeeListViewModel\EmployeeListViewModel.cs:54中
12-02 14:06:53.355 I/mono标准输出(2032):在cirrium.CrossCore.Core.MvxMainThreadDispatcher.ExceptionMaskedAction(System.Action动作)[0x00000]in:0
在cirrium.CrossCore.Core.MvxMainThreadDispatcher.ExceptionMaskedAction(System.Action动作)[0x00000]中:0
12-02 14:06:53.355 I/mono标准输出(2032):InnerException为MobileServiceInvalidOperationException:服务器未提供具有预期内容的响应。
InnerException为MobileServiceInvalidOperationException:服务器未提供具有预期内容的响应。
在Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+d_u1C.MoveNext()[0x00000]中:0
12-02 14:06:53.355 I/mono标准输出(2032):位于Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+d_u1C.MoveNext()[0x00000]in:0
---来自引发异常的上一个位置的堆栈结束跟踪---
12-02 14:06:53.355 I/mono标准输出(2032):--来自引发异常的前一个位置的堆栈结束跟踪---
0中的System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()[0x00000]处
12-02 14:06:53.365 I/mono标准输出(2032):位于System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()[0x00000]中:0
12-02 14:06:53.365 I/mono标准输出(2032):在System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult()[0x00000]中:0
在System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult()[0x00000]中:0
12-02 14:06:53.385 I/mono标准输出(2032):在Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+d_u4.MoveNext()[0x00000]中:0
我将MvvmCross/MobileServiceAzure与Android一起使用,并将WindowsPhone与ToListSync()一起使用。它很好用。您是否有示例代码或演示项目?“服务器未提供具有预期内容的响应”表明从服务器返回的json响应为空-。某种类型的示例代码可能有助于调试此代码