Setting SystemTrigger or ApplicationTrigger as background task triggers throws exception when registering
Describe the bug
I'm looking to create Win32 COM background task with Time, System and Application Triggers. Time works, but when System or Application triggers are set, calling BackgroundTaskBuilder.Register throws the following exception
System.Runtime.InteropServices.COMException: "Incompatible request (0x80070032)"
Steps to reproduce the bug
In BackgroundTaskWinMainComSample/CS project from DesktopBridgeToUWP-Sample repository I'm able to replicate the issue.
Only thing needed to update is at MainWindow.xaml.cs:172, change the Time trigger by any of the others mentioned:
RegisterBackgroundTaskWithSystem(new SystemTrigger(SystemTriggerType.SessionConnected, false), typeof(TimeTriggeredTask).GUID, typeof(TimeTriggeredTask).Name);
RegisterBackgroundTaskWithSystem(new ApplicationTrigger(), typeof(TimeTriggeredTask).GUID, typeof(TimeTriggeredTask).Name);
Expected behavior
It should be able to register the task and triggers should work.
Screenshots
No response
NuGet package version
Windows App SDK 1.4.0: 1.4.230822000
Packaging type
Packaged (MSIX)
Windows version
Insider Build (xxxxx)
IDE
Visual Studio 2022
Additional context
No response
@bpulliam what's the status here?
Same issue here, I am trying to use new SystemTrigger(SystemTriggerType.TimeZoneChange, false)