I am currently experimenting with the latest possibilities in Visual Studio 19 preview 2, to develop a packaged WPF desktop app that is using WinUI 3 for the UI.
I know that all of this is not yet intended for production use but I would like to understand whether somewhere in 2021 this could be a better approach for developing apps for the Windows Store instead of UWP, DesktopBridge, or WPF with XamlIslands.
In particular I would like to know whether WPF desktop apps on .NET 5 and WinUI 3 are supporting or eventually will support Background Tasks in the way they are supported on UWP apps. The beauty of the latter is that registration/deregistration of background tasks on installation/update/deinstallation of the app works seamlessly. It would be great if this would also work with a WPF Desktop app.
I experimented a little bit with this and discovered that I can write code to register an out-of-process background task using the standard provisioned api (Microsoft.Windows.SDK.NET.dll). However, it is not possible to reference a c# Windows Runtime Component that would implement the background task. There are currently only 2 type of Windows Runtime Component templates in Visual Studio 19, prev2:
Windows Runtime Component (WinUI in UWP) for a managed (c#) .winmd, and
Windows Runtime Component (WinUI) for a unmanaged (c++) .winmd.
None of them can be referenced / included in a .NET5 app.
My question basically is: does it make any sense to continue working in this direction or should I have to look for alternative ways to have some type of background tasks?