AgentExitReason Enumeration

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

Lists the possible reasons for which a background agent exits. Use the LastExitReason property of the ScheduledTask class to determine why the task exited its most recent execution.

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


Public Enumeration AgentExitReason
public enum AgentExitReason
<object property="enumerationValue" .../>


Member name Description
None The agent has never been executed.
Completed The agent exited by calling NotifyComplete. An agent should always call this method when it has completed its intended task.
Aborted The agent exited by calling the Abort method. After this method is called, the IsScheduled property will be set to false and the agent will not be run again unless the foreground application reschedules it.
MemoryQuotaExceeded The agent was terminated by the system because it exceeded the memory cap for background agents.
ExecutionTimeExceeded The agent was terminated by the system because the allotted time for execution has been exceeded.
UnhandledException The agent was terminated because an unhandled exception occurred.
Terminated The agent was terminated by the system due to the state of the device or operating system.
Other An internal system error caused the agent to be terminated.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1


Windows Phone

See Also


Microsoft.Phone.Scheduler Namespace