Background Task vs Windows Services


  • What's the difference for them? When to use background task?
    Sunday, February 26, 2012 9:02 AM


  • Hi,

    Metro App runs in isolated sandbox and cannot access local Windows Service.
    Background Task is brand-new concept completely different from Windows Service.
    Background Tasks are an integral part of the metro style application lifecycle. They only run under certain conditions.
    The background task execution environment is a restricted resource-managed environment. Background tasks should be used for small work items that have no interaction with the user and only provide limited service.
    The background task executes in either the system-provided backgroundTaskHost.exe or the app process.

    Scenarios that are appropriate for background tasks include downloading mail in the background, or showing a toast notification for an incoming VOIP call or a chat message, or reacting to a change in system condition (for example, UserAway) and updating the server with this information. Scenarios that are not appropriate for background tasks are indexing mail, transcoding photos, running SETI type workloads, or anything that requires user interaction through displaying UI or audio.

    Please see the whitepaper Introduction to Background Tasks and an example Background Task Sample to have a deep understanding on Background Task.

    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, February 26, 2012 12:54 PM