How do I get Out-Of-Process BackgroundTasks to work in a Multi-Instanced Windows 11 UWP app?

Sacha B 116 Reputation points
2023-07-12T18:17:11.2+00:00

I have a fairly major Store app with millions of downloads written in C# & C++ UWP. It has a very complex Trigger-based BackgroundTask saving system. It is very mature, thoroughly tested in the field, and works excellently normally!

I have been trying to add multi-instance support to the app. The Multi Instancing works well, besides 1 issue with the "Out-Of-Process" BackgroundTasks. I have read through every guide online.

When multi-instancing is enabled via <Application desktop:SupportsMultipleInstances="true" ...>, the multi-instancing works great. The problem is when this is enabled, the trigger-based BackgroundTasks do not fire.

  • They fire correctly when SupportsMultipleInstances is false
    • BackgroundTasks show in task manager firing and I can also debug the code
  • When SupportsMultipleInstances is true
    • BackgroundTasks do not show in task manager or debug the code
  • Again these are Out-Of-Process BackgroundTasks which multi-instancing should support.
  • In addition, it is successfully registering or resuming the BackgrounTask with both.
Universal Windows Platform (UWP)
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,791 questions
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 20,441 Reputation points Microsoft Vendor
    2023-07-17T02:07:32.9+00:00

    Hi @Sacha B ,

    I discussed this question with the team, this behavior is a known issue, and there is no workaround yet.

    If you have to use ApplicationTrigger, it is recommended that you do not use multiple instances for the time being. If you want to get further technical support, I suggest that you might need to open a support ticket for this. Please contact our paid support at MS Support. You will get 1:1 support on that. Select Developer Tools -> Windows UWP Development -> Windows 10 Universal App Dev -> Runtime Platform -> Background tasks and transfers API in the support page and you could contact the team. Please kindly note that your support ticket will be free if it is Microsoft's issue.

    Thank you

    Junjie


0 additional answers

Sort by: Most helpful

Your answer

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