TaskEntryPoint | taskEntryPoint property

BackgroundTaskBuilder.TaskEntryPoint | taskEntryPoint property

Gets or sets the class that performs the work of a background task.


Public Property TaskEntryPoint As String

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The name of an application-defined class that performs the work of a background task.


Windows Store apps using C++, C#, or Visual Basic:  The task entry point class must implement the IBackgroundTask interface. The system calls IBackgroundTask::Run when the background task is triggered. In addition, the class must be specified in the <Extensions> section of the application's manifest as <Extension Category="windows.backgroundTasks" EntryPoint="appNamespace.appClassName">.

The task entry point class can be implemented in the same process as the application's foreground component (in-proc); however, it cannot run on any of the application's foreground threads because the application might be suspended when the background task is triggered. For best results, implement the class in a separate process (out-of-proc) to decouple it from the application's foreground components and allow the system to manage the application's processes more efficiently.

Windows Store apps using JavaScript:  The entry point for a JavaScript background task is a JavaScript start page. See WebUIBackgroundTaskInstance.current for more information.

Note that JavaScript background tasks must call close() to terminate when they are done, so they don't continue to consume the user's memory and battery.

The following example shows a BackgroundTaskBuilder being used to register a JavaScript background task:

var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();
builder.taskEntryPoint = "js\\backgroundtask.js";

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::ApplicationModel::Background [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::ApplicationModel::Background [C++]



See also




© 2016 Microsoft