I’ve created an Windows Phone app that has a User interface app and background task to do some stuff periodically. The programs seems to run OK, no error messages and also seems to schedule the agent. The strange this is, that the agent never runs and there is no message / error or trace that indicates a problem.
One other detail is that on Settings -> Applications -> “background task” the app is not listed there. If the task should be working OK, than there should be the program name. So apparently the Windows Phone does not see the periodic agent. There is no error whatsoever, no indication but the agent just does not run at all.
What is the solution that I’ve found so this problem: in order to start the the agent you must add a reference to the agent project in the front-end (user interface) project. Without this reference, the periodic task will never start. You add the reference by doing the following:
- Go to the solution explorer
- right click References
- Add Reference
- Select the agent project from the list
If you run the Windows Phone app now, it should schedule the agent as I intended.
Simple once you know IT.