windows-phone-8background-agents

Any Tips for getting Windows Phone 8 Resource Intensive Task to Run?


I have been trying to get a Resource-Intensive Task background agent to run in release mode after deploying to the phone for several days and have never seen it run. Has anyone got this to work outside of the debugger? How long did you have to wait before it ran?

I am able to launch and successfully run the Resource-Intensive Task using the LaunchForTest but have never gotten it to run as it should in release mode even though the task shows that it is scheduled. I have followed the samples and the phone should have met the requirements for launch. I have set the manifest up for auto-upload as well so shouldn't need to set an expiration date on the task.

The phone is plugged in and charging and battery is 100%. The phone has wifi access. The phone is on the lock screen and left this way over night for 2 nights.

I have tried this both on a Nokia Lumia 920 and HTC699OL

I am able to get a Periodic Task to run but not the Resource-Intensive Task. If the Periodic runs, I'm assuming I have configured everything correctly in the WMAppManifest and the Resource-Intensive Task should run at some point?

The Resource-Intensive Task shows the following:

The app shows up in the Settings > Background tasks > advanced.

Running the Store Kit test shows no API call problems for the phone application and I have a reference to the agent project from the main phone app project.

Here is my WMAppManifest setting for the agent:

<ExtendedTask Name="BackgroundTask">
    <BackgroundServiceAgent Name="SML.Sync.WP8.Agent" Specifier="ScheduledTaskAgent" Source="SML.Sync.WP8.Agent" Type="SML.Sync.WP8.Agent.BackgroundUploadAgent" />
</ExtendedTask>

This seems correct based on the MSDN documentation here: MSDN Task Element documentation

Here is the auto-upload extension, which follows the Tokens node:

<Extensions>
  <Extension ExtensionName="Photos_Auto_Upload" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" TaskID="_default" />
</Extensions>

I have also tried it without the auto-upload setting and had the same result of never running.

I have also tried getting the example from here http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202941(v=vs.105).aspx to run but after removing the debug_agent and deploying as release mode, I see the same issue, never gets run even though it says its scheduled - periodic does run just not resource-intensive.

I know that the documentation says that it may never run but it seems like 2 days passing and meeting the task requirements should work. Do I need to wait a week to see if this sucker runs?

Would be greatly appreciative of any guidance or tips if you have gotten a Resource-Intensive task to actually run in release mode.


Solution

  • I opened a support incident with Microsoft on February 4th 2013 and heard back from them February 5th with the following:

    I collaborated with the internal Windows Phone developers and confirmed the following:

    1. ResourceIntensiveTask (i.e. Resource Intensive Agent) does not get triggered in the Windows Phone 8 operating system in Release Mode.
    2. FYI, Auto-upload uses ResourceIntensiveTasks, so it does not work in WP8 either.
    3. A fix is scheduled for inclusion in a future Windows OS update, most likely later this spring. The fix needs to propagate through the OEMs who build their hardware-specific versions of the Windows Phone 8 OS.
    4. There is no known immediate/official workaround.