Debugging BackgroudTasks in Windows and Windows Phone 8.1

  think most Windows Store app developers will know this, but now it gets important for Phone developers too. With the new Windows Phone release the whole architecture how to build an app from windows store apps will be coming to Windows Phone.

Windows Store apps has the concept of BackgroundTasks. These tasks can run on the background and provide functionality to the end user without the new to start up the app. It can be used to update data, or update the live tile for example.

A background tasks is register in the app and a BackgroundTask needs a trigger when it runs, this can be a timetrigger, which triggers a task every x minutes, or a push notification for example.

To debug these background tasks can be little hard if you going to really trigger the event you bound. Like in case of a timetrigger wait x minutes till your tasks get triggers. X needs to be at least 15 minutes which makes it a time consuming operation.

Lucky microsoft found nice solution for it, although it is bit hidden. You can trigger a Backgroundtasks that is registered from Visual Studio. To do this start debugging you application. Then go to View -> Toolbars -> Debug Location

Then you click on the Lifecycle events button and you can test suspending, resume, suspend and shutdown but also trigger almost all your background tasks.

  •   @MicrosoftHelps fixed it by reinstalling windows but thanks for following up
  •   @JenMsft should have log feedback before resetting windows... but was soo annoyed my pen was not working
  •   @JenMsft surface book with perf base. i reinstalled windows and problem is gone. nasty thing if multi touch doesnt… https://t.co/0vxuKMC6vv
  •   @JenMsft after i installed the FCU multitouch doesnt work. when uninstall driver and reboot it works till next reboot. heared it before?
  •   RT @ruudj: https://t.co/WWSQcFP45k
  •   @maarten_goet @we_are_inspark Nice congrats
  •   nice app showing all windows controls https://t.co/kogun2ws2P
  •   RT @windowsblog: New Map Control features in Windows 10 Fall Creators Update https://t.co/gTLqVAX8HO https://t.co/wuGGF6Yi3Q
  •   RT @LocalJoost: Rather loud explosion sounds at @davesmits #techdaysnl presentation. Who ever was asleep is definitely awake again now 😀
  •   RT @we_are_inspark: 'A Shared HoloLens experience' door @davesmits op @TechDaysNL. Volg zijn sessie over 30 min. in zaal G104-105. https://…