1
我正在为Background代理编写Windows Phone 7.5应用程序。我加入的代码无法在Visual Studio 2010中获取ScheduledActionService.LaunchForTest()方法
ScheduledActionService.LaunchForTest(
periodicTaskName,
TimeSpan.FromSeconds(20));
方法,但这种方法它显示我的错误
错误Microsoft.Phone.Scheduler.ScheduledActionService”不包含定义‘LaunchForTest’
仅供参考我检查了没有'LaunchForTest'方法的定义。如果有人知道如何获得,请回复。
public sealed class ScheduledActionService
{
// Summary:
// Registers a scheduled action with the operating system.
//
// Parameters:
// action:
// The Microsoft.Phone.Scheduler.ScheduledAction to be registered.
//
// Exceptions:
// InvalidOperationException:
// A scheduled action with the same Microsoft.Phone.Scheduler.ScheduledAction.Name
// property is already registered with the system.
public static void Add(ScheduledAction action);
//
//
// Returns:
// Returns Microsoft.Phone.Scheduler.ScheduledAction.
public static ScheduledAction Find(string name);
//
//
// Type parameters:
// T:
//
// Returns:
// Returns System.Collections.Generic.IEnumerable<T>.
public static IEnumerable<T> GetActions<T>() where T : ScheduledAction;
public static void Remove(string name);
public static void Replace(ScheduledAction action);
}
您是否确认该项目的目标是Windows Phone 7.1(在项目属性的“应用程序”选项卡上)? – 2012-02-01 13:41:54