In UWP, the Update Task is a deployment task. It is invoked by the operating system after the user installs an update, it is declared in the package manifest, and it does not need to be registered from code. That is why it can still run for an app that has never been launched before the update. Run a background task when your UWP app is updated
For WinUI 3, the background task model is different. The Windows App SDK guidance is to register background tasks using the BackgroundTaskBuilder class, and the app must be packaged with MSIX. In this model the manifest is used to declare the background task app extension and to register the COM server, while the trigger registration itself is still done in code.
Using background tasks in Windows apps
For migration from UWP, out of process background tasks can keep the existing WinRT component, packaged together with the desktop project. When the trigger is invoked, the broker infrastructure launches backgroundtaskhost.exe and the WinRT component runs inside that process. In process background tasks cannot be migrated as is, because the OnBackgroundActivated callback is not available in a WinUI application.
Background task migration strategy
So the closest supported approach is:
- Implement the task as a WinRT component that implements
IBackgroundTask. - Package your WinUI 3 app with MSIX, since this is required for Windows App SDK background tasks.
- Include the component in the package and declare the background task app extension in
Package.appxmanifest.
There is currently no dedicated Windows App SDK documentation confirming a manifest only windows.updateTask registration for WinUI 3, so I recommend validating this with a test package before relying on it in production.
If you found my response helpful or informative, I would greatly appreciate it if you could provide feedback by interacting with the system or leaving a comment below.