ScheduledTask.LastExitReason Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the reason that the agent exited the last time it was run.

Namespace:  Microsoft.Phone.Scheduler
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)


Public Property LastExitReason As AgentExitReason
public AgentExitReason LastExitReason { get; internal set; }

Property Value

Type: Microsoft.Phone.Scheduler..::.AgentExitReason
The reason the agent exited.


An agent should always call NotifyComplete when it has completed its intended task. If an agent runs successfully and calls NotifyComplete, its LastExitReason property will have the value Completed.

If an agent is unable to complete its intended task, it should call Abort. If this method is called by the agent, the LastExitReason will be Aborted and the IsScheduled property for the associated ScheduledTask will be set to false. The agent will not be run again until it is rescheduled by the foreground application.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1


Windows Phone

See Also


ScheduledTask Class

Microsoft.Phone.Scheduler Namespace