which process host my background task? RRS feed

  • Question

  • I created a Metro app which do some lengthy tasks in background. But i don't know if the background task will be running with my app within the same process. how can i differentiate it?
    Sunday, May 27, 2012 5:54 AM


  • Hi,

    In general, it depends on your programming language, background task types, or trigger type.

    For C# and C++ apps, the background task is implemented in a class library, and this class library can run within the main app or in the system provided BackgroundTaskHost.exe.
    Different trigger types or background task types have different restrictions on where the background task can be hosted.
    By default, the background task runs in the system provided BackgroundTaskHost.exe.
    Only background tasks that contain PushNotificationTrigger or ControlChannelTrigger task types can specify an executable other than BackgroundTaskHost.exe.
    If a background task executes in the system-provided BackgroundTaskHost.exe, it is launched independently of the state of the app. It is not necessary for the system to change the app’s state.
    This option is preferable because launching the task within BackgroundTaskHost.exe is faster, uses fewer resources, and overall, provides better performance than launching the background task within the app.

    For JavaScript apps, the executable attribute should not be specified because JavaScript apps are loaded in a web worker within the default host.

    Best wishes,

    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, May 27, 2012 6:22 AM