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