Reputation: 17
I don't know how much about BackgroundWorker, and I have a problem. My BackgroundWorker is correctly running to completion when my app is open, but if my app is closed the BackgroundWorker does not complete.
Is there any way to force a BackgroundWorker to continue running when my app is closed, rather than the BackgroundWorker terminating?
Upvotes: 0
Views: 210
Reputation: 39027
Any task launched by your application will stop executing when your app is closed, and there's nothing you can do against that (well, there's a few very specific exceptions, like geolocation apps).
If you need to run code while your app is closed, you need to use a background agent. Note that those agents have a few limitations, especially in memory usage, and can run only for a few seconds every 30 minutes.
Upvotes: 2
Reputation: 2070
You will need a Background Agent
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202942(v=vs.105).aspx
Upvotes: 0