I have a Windows Phone 7 application deployed on the market that updates its Live Tile using the PeriodicTask phono agent.
One user reports tile issues that are no longer updated after they have been working for some time.
When they check background tasks on the phone, it is disabled, and the checkbox "Enable background tasks for this application the next time it is opened" is checked.
After opening the application and repeating the pin operation, the background task is not resumed.
I suspect this could be due to two crash reports I saw in the App Hub:
Problem Function: Microsoft.Phone.Scheduler.SystemNotificationInterop.CheckHr
Exception Type: ArgumentException
Stack trace:
The offset function image frame
0 coredll.dll xxx_RaiseException 19
1 296 mscoree3_7.dll WatsonUnhandledManagedException
2 mscoree3_7.dll Dbg_NotifyManagedException 93
3 mscoree3_7.dll FirstPassException 1044
4 TransitionStub 0
5 248 Microsoft.Phone.Scheduler.SystemNotificationInterop.CheckHr
6 Microsoft.Phone.Scheduler.SystemNotificationInterop .GetNotificationByID 156
7 Microsoft.Phone.Scheduler.ScheduledActionService.Find 276
8 MyApp.Agents.TaskIsActive 60
9 MyApp.MainPage.SetupApplicationBar 44
10 MyApp.MainPage.MainPage_Loaded 100
11
MS.InternvHel.Helor.ellertel.leer.ellertel.lelertel.60.mserntel.help.inlerhelorellertore .FireEvent 1348
13 mscoree3_7.dll IL_CallManaged 884
14 mscoree3_7.dll IL_CallDelegateInternal 176
15 mscoree3_7.dll MakeComPlusCall 5255
16 mscoree3_7.dll makeComPlusCallReturnInt 21
17 0
18 agcore.dll CCoreServices :: CLR_FireE
Calls to Microsoft.Phone.Scheduler.ScheduledActionService.Find throw an ArgumentException.
The name parameter that I call the Find with method comes from private const string, so the value will be the same with every call.
Should I just catch this exception and assume that the background agent is missing or does it indicate that something is wrong with the agent?
At this point, I cannot throw an exception when the application starts in the emulator.
"When the [] background agent fails twice in a row, it is removed from the planning"
ScheduledAgent :
protected override void OnInvoke(ScheduledTask task)
{
UpdateTile();
#if DEBUG
ScheduledActionService.LaunchForTest("MyScheduledTaskAgent", new TimeSpan(0, 0, 30));
throw new Exception("Bang");
#endif
NotifyComplete();
}
, . , , ScheduledActionService.Find . PeriodicTask .
" , . , ScheduledActionService.Add, ScheduledActionService.Find"
. ScheduledActionService.Add(task);:
System.InvalidOperationException - " BNS: \r\n"
ScheduledActionService.Find .