简体   繁体   English

Azure移动服务:InsertAsync上的异常

[英]Azure Mobile Services : Exception on InsertAsync

I'm trying to do an insert to a windows Azure mobile service db from a Xamarin applicaiton. 我正在尝试从Xamarin应用程序插入Windows Azure移动服务数据库。 the insert works fine. 插件工作正常。 but i get the following exception. 但我得到以下异常。

i see there are some issues related to the below link looks related to this. 我看到下面的链接看起来与此有关。 but still cannot get it working for me. 但仍然无法让它为我工作。

http://aspnetwebstack.codeplex.com/workitem/1797 http://aspnetwebstack.codeplex.com/workitem/1797

Exception=System.NullReferenceException: Object reference not set to an instance of an object.
   at xPlatAuction.Backend.Controllers.BidController.<PostBid>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext(), Id=855e229d-5653-45c3-9e9a-178a3aea5244, Category='App.Filters'

The exception logs you mentioned, it might have missed up some I/P parameters which throws NULL reference, the Insert sync method was working fine previously. 您提到的异常日志,它可能错过了一些引发NULL引用的I / P参数,Insert sync方法以前运行良好。

You have not mentioned about the inputs you gave, please find some areas where the error : 您尚未提及您提供的输入,请找到一些出现错误的地方:

  1. As you are developing an application tackling cross platform (Using Xamarin ie you may be developing Android or IOS or Windows App & Interacting with Azure Mobile Services). 在开发跨平台的应用程序时(使用Xamarin,即您可能正在开发Android或IOS或Windows App并与Azure移动服务进行交互)。 So there may be an issue with the object inputs 因此对象输入可能存在问题

  2. Input URL would have been wrongly formatted . 输入URL的格式错误 You may use following reference too (this Insert sync method was working fine previously too). 您也可以使用以下参考 (此插入同步方法以前也可以正常工作)。

You can also take a look at following question: 您还可以查看以下问题:

How can I read data from a table in Microsoft Azure Mobile Services and put it in my application? 如何从Microsoft Azure移动服务中的表中读取数据并将其放入应用程序中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM