I tried to follow this example from Microsoft, best I can tell I did everything except putting the ScheduledTaskAgent and PeriodicTask in a seperate assembly. When I run my app in the emulator and try to launch the Periodic task using:
ScheduledActionService.LaunchForTest(_task.Name, TimeSpan.FromSeconds(60));
Nothing happens, no exceptions and after a minute the ScheduledTaskAgent never starts and when I look under “Settings > Background Tasks” on the emulator nothing is listed.
I tried to follow this example from Microsoft, best I can tell I did
Share
Yes, they need to be in a separate assembly, and you need to reference it in your
WMAppManifest.xaml, like this:You can read on MSDN what the correct values for the
BackgroundServiceAgentattributes are.If you use the Visual Studio Windows Phone Scheduled task Agent template, the
BackgroundServiceAgenttask is automatically added in theWMAppManifest.xamlwith the correct values.