locked
Exception: System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess

    Question

  • Hey 

    I have a method like this.

    		internal async Task GetFirstRecords()
    		{
    			if (!IsServiceStarted)
    				return;
    			await ClearMeasurements(); // clear obserablecollection which bound to xmal
    			await this.GlucoseServiceHandler.GetFirstRecord(); //sending bluetooth command over gatt service 
    		}

    Error message I got:

    "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n

    at Common.Service.GattService.GlocuseService.<GetFirstRecord>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at nRFToolbox.ViewModels.GlucoseMonitorViewModel.<GetFirstRecords>d__20.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n

    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at nRFToolbox.GlucoseMonitor.<GetFirstRecordClicked>d__16.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n

    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)\r\n at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()"


    This error occurs if I am intensively click button to trigger this method. But it works fine if I am just click it gentally.

    Ps I am using VS 2013 .Net 4.5.1 Windows Store App development

    Any explanation?


    Jiajun Qiu

    Thursday, March 19, 2015 11:43 AM

All replies

  • Hi Jiajun,

    Since it is related to the Windows Store app, I help you move this thread to the Building Windows Store apps with C# or VB forum for dedicated support.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 20, 2015 5:47 AM
  • HI JIAJUN.QIU,

    >>Ps I am using VS 2013 .Net 4.5.1 Windows Store App development

    Have you tried to change the target framework to 4.5 and check if this issue still exists?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 20, 2015 6:00 AM
    Moderator