I recently read about something similar and i did not try it out myself, but it seems to me like the runtime cancells your operation.
try notifying the runtime of your outstanding operation by requesting a
SuspendingDeferral[
^]:
private async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) {
var deferral = e.SuspendingOperation.GetDeferral();
await service.SetUserOnlineStatusAsync(UserId, 0);
deferral.Complete()
}
in any case you should be aware that the runtime will terminate anyway, if the "deadline for suspension has passed" - whatever timespan this is...if you find out, let me know ;)