I had (and I have) the same problem, but I noticed only in the first launch of my application after starting the emulator that my code was working, but backgroundtask also exited from 1.
My solution for this is that every time I run the application, I unregister and re-register the task:
var task = BackgroundTaskRegistration.AllTasks.SingleOrDefault(i => i.Value.Name == "PushBackgroundTask"); task.Value.Unregister(true); RegisterBackgroundTask();
This allows me to execute my code every time, but backgroudTask always exits from 1.
I found this link how to debug backgroundtask , but so far Iβm not lucky to find the problem
source share