问题描述
部署到电话几天后,我一直试图让资源密集型任务后台代理在发布模式下运行,但从未见过它可以运行.有人在调试器之外工作吗?您必须等待多长时间才能运行?
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?
我能够使用LaunchForTest启动并成功运行资源密集型任务,但是即使任务显示已计划,我也无法使其在发布模式下正常运行.我已按照示例操作,并且手机应符合启动要求.我还为自动上传设置了清单,因此无需在任务上设置到期日期.
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.
手机已插入电源并正在充电,电池电量为100%.手机可以使用wifi上网.手机在锁定屏幕上,并以这种方式放置了整晚的两个晚上.
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.
我在诺基亚Lumia 920和HTC699OL上都尝试过
I have tried this both on a Nokia Lumia 920 and HTC699OL
我可以运行一个定期任务,但不能运行资源密集型任务.如果定期运行,我假设我已经在WMAppManifest中正确配置了所有内容,并且资源密集型任务应该在某个时候运行?
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
- 到期时间:12/31/9999 11:59:59
- LastExitReason:无
该应用程序显示在设置">后台任务">高级"中.
The app shows up in the Settings > Background tasks > advanced.
运行Store Kit测试显示电话应用程序没有API调用问题,我从主电话应用程序项目中引用了代理项目.
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.
这是我对代理的WMAppManifest设置:
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>
根据此处的MSDN文档,这似乎是正确的: MSDN任务元素文档
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.
我还尝试从此处获取示例 http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/hh202941(v = vs.105).aspx 可以运行,但是要删除debug_agent并作为发行版进行部署模式,我看到了同样的问题,即使它说它是计划的,也永远不会运行-周期性的运行确实不会占用大量资源.
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.
我知道文档说它可能永远不会运行,但是似乎经过2天并且满足任务要求应该可以工作.我是否需要等待一周才能查看此吸盘是否运行?
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.
推荐答案
我于2013年2月4日向Microsoft发起了一次支持事件,并于2月5日收到他们的回音,内容如下:
I opened a support incident with Microsoft on February 4th 2013 and heard back from them February 5th with the following:
- ResourceIntensiveTask(即资源密集型代理)在发布模式下的Windows Phone 8操作系统中未触发.
- 仅供参考,自动上传使用ResourceIntensiveTasks,因此在WP8中也不起作用.
- 计划在将来的Windows OS更新中包含一个修复程序,很有可能在今年春季晚些时候发布.该修复程序需要通过 生成其硬件特定版本的Windows Phone 8的OEM 操作系统.
- 没有已知的立即/官方解决方法.
- ResourceIntensiveTask (i.e. Resource Intensive Agent) does not get triggered in the Windows Phone 8 operating system in Release Mode.
- FYI, Auto-upload uses ResourceIntensiveTasks, so it does not work in WP8 either.
- 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.
- There is no known immediate/official workaround.
这篇关于运行Windows Phone 8资源密集型任务的任何提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!