4

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:

  • IsEnabled = true
  • IsShceduled = true
  • LastScheduledTime: 1/1/0001 12:00:00
  • ExpirationTime: 12/31/9999 11:59:59
  • LastExitReason: None

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.

Jeff Zickgraf
  • 177
  • 1
  • 12
  • Problem with wireless is that it turns off very soon after locking the screen .. maybe thats the problem. So I guess it can only run in a very short time after lockin screen (And seems like you have to be "lucky" to get it to run) – Flo Feb 07 '13 at 12:22

3 Answers3

5

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.
Jeff Zickgraf
  • 177
  • 1
  • 12
  • 3
    Wow that really sucks. Having alot of trouble myself with WP8 with missing documentation and stuff, but "does not work in release mode" .. ouch – Flo Feb 12 '13 at 08:48
1

The recent GDR2 update has fixed this. I verified that Resource-Intensive Task is running on my phone.

Luke Zhang
  • 31
  • 2
0

If you want to upload something in background, maybe you dont even need this Task. You could give this a try:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202955%28v=vs.105%29.aspx

Sample is here:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202959%28v=vs.105%29.aspx

Flo
  • 1,660
  • 4
  • 21
  • 34
  • Yes, aware of the background file transfer and it isn't ideal for us but we'll have to use it as a workaround. Microsoft has confirmed a bug in the Resource-Intensive Task feature so until its fixed and distributed to phones, we'll probably be using the file transfer feature. – Jeff Zickgraf Feb 11 '13 at 21:22