Implement windows.UpdateTask in WinUI3.0 by registering it in package.appxmanifest file

Rajendra Rajput 0 Reputation points
2026-08-07T12:16:40.3433333+00:00

Hi,

Need to implement windows.UpdateTask as background task in WinUI3.0.

This task should get triggered whenever the application is updated.

But the task should be registered only through Package.appxmanifest file.

It should not be registered through code.

Is this possible in WinUI3.0 like it is in UWP?

Thanks & Regards,

Rajendra B Rajput

Windows development | WinUI
0 comments No comments

4 answers

Sort by: Newest
  1. Rajendra Rajput 0 Reputation points
    2026-08-18T06:59:02.6533333+00:00

    Hi,

    Please refer my answer below.

    Was this answer helpful?

    0 comments No comments

  2. Rajendra Rajput 0 Reputation points
    2026-08-17T09:13:16.47+00:00

    Hi,

    Please refer my answer below.

    Was this answer helpful?

    0 comments No comments

  3. Rajendra Rajput 0 Reputation points
    2026-08-13T07:35:58.8333333+00:00

    Hi Jay Pham,

    Thank you for your response.

    I implemented windows.UpdateTask in WinUI 3 by doing trigger registration in code.

    Does that mean that we cannot implement windows.UpdateTask just by declaring the background task app extension in manifest file?

    The closest supported approach which you described above is that a hybrid approach where the task will be implemented as a WinRT component in UWP (WinRT component is not available in WinUI 3) & remaining app in WinUI 3?

    Thanks & Regards,

    Rajendra

    Was this answer helpful?


  4. Jay Pham (WICLOUD CORPORATION) 4,435 Reputation points Microsoft External Staff Moderator
    2026-08-10T00:25:19.8+00:00

    Hi @Rajendra Rajput

    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:

    1. Implement the task as a WinRT component that implements IBackgroundTask.
    2. Package your WinUI 3 app with MSIX, since this is required for Windows App SDK background tasks.
    3. 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.

    Was this answer helpful?

    2 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.