Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Debugging Windows Store app Background Tasks

DZone's Guide to

Debugging Windows Store app Background Tasks

· Performance Zone
Free Resource

Download our Introduction to API Performance Testing and learn why testing your API is just as important as testing your website, and how to start today.

 Windows Store apps can run operations in the background using background tasks. Background tasks are triggered using a background triggers like time or system maintenance. That raises a question which is how we can debug background tasks.

Visual Studio 2012 to the Rescue

Visual Studio 2012 can help you trigger a background task manually. First you need to add a breakpoint to the background task code that you want to check. After you set your breakpoint, you can trigger the background task using the Suspend drop down menu (part of the Debug Location toolbar). The Suspend drop down menu shows all the background tasks associated with the running app. In the next figure you can see the MyBackgroundTask task available in the suspend drop down menu:

Background Task in the suspend menu

Pressing the background task name will manually trigger the task.

Manually triggered Background Task

Pay attention that if the background task isn’t registered nothing will happen and you won’t be able to debug it. 

That is it and now you can debug your code.

Summary

Visual Studio 2012 includes a feature that enables background task debugging. Knowing that can help you avoid waiting to trigger events to happen.

Find scaling and performance issues before your customers do with our Introduction to High-Capacity Load Testing guide.

Topics:

Published at DZone with permission of Gil Fink, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}