LaunchForTest Method
Collapse the table of content
Expand the table of content

ScheduledActionService.LaunchForTest Method

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

Causes the background agent associated with a ScheduledTask to be run in the background after the specified delay.

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

Public Shared Sub LaunchForTest ( _
	name As String, _
	delay As TimeSpan _


Type: System.String
The name that uniquely identifies the ScheduledTask object.
Type: System.TimeSpan
The delay after which the associated background agent should be run.


A ScheduledTask with the specified name is not registered with the Scheduled Action Service.

The ExpirationTime for the ScheduledTask has already passed.


The supplied object is not a ScheduledTask object.

Use this method during application development to test your background agent implementation. Background agents are launched by the operating system according to the type of agent and the current state of the system. This scheduling logic is described in Background agents for Windows Phone 8. You can use this method to launch an agent more frequently from your foreground application or from the agent itself in order to test the agent execution. This method should only be used during development. You should remove calls to this method from your production application.

Caution noteCaution:

You should set the delay value to at least 60 seconds to ensure that the background agent will be launched. Delay times less than 60 seconds may result in the background agent not being launched.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2017 Microsoft