I'm using the async ctp and have a task that runs in the background. It works great but throws an exception when it's running and the app is tombstoned. The exception is related to the database context being null.
The docs say:
When an application is tombstoned, the underlying database connections are closed. To return to its previous state after tombstoning, an application needs to redo any queries it had performed before it was tombstoned.
I've tried using a cancellationtokesource but this doesn't seem to work as the connection is already closed. Any idea how to handle something like this?