I am trying to use the following:
private async void RunBackgroundTask()
{
string entryPoint = "BackgroundTask.AudioBackgroundTask";
string taskName = "task";
ApplicationTrigger trigger = new ApplicationTrigger();
BackgroundTaskRegistration task = RegisterBackgroundTask(entryPoint, taskName, trigger, null);
await Task.Delay(1000);
var result = await trigger.RequestAsync();
}
If I try to use as is I receive in the result an UnknownError, and I think is because I have to add the Task systemEvent in the declarations as following:
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="BackgroundTask.AudioBackgroundTask">
<BackgroundTasks>
<Task Type="audio" />
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
</Extensions>
But surprise is no longer supported, I receive the following error:
Severity Code Description Project File Line Suppression State Error Error : DEP0700 : Registration of the app failed. AppxManifest.xml(32,10): error 0x80080204: Cannot register the e77f1d84-cd41-4053-8a84-2db36d0cbd8e_1.0.0.0_x86__dy4sgpjxhat8m package because the extension is missing an EntryPoint or StartPage attribute. (0x80073cf6) BackgroundAudioGraph
I have also set all the application and the task to 10240 but the same, how can be possible because I saw even in @Jerrynixon example:
https://github.com/Windows-XAML/201505-Ignite/blob/master/BackgroundTask/MyApp/Package.appxmanifest
the systemEvent declared task, so I do not know how to follow.
Thanks!
User contributions licensed under CC BY-SA 3.0