2012-02-01 77 views
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); 
    } 
+0

您是否確認該項目的目標是Windows Phone 7.1(在項目屬性的「應用程序」選項卡上)? – 2012-02-01 13:41:54

回答

0

有沒有機會安裝舊版本的SDK?一個測試版可能?

驗證Microsoft.Phone裝配是版本7.0.0.0和文件版本3.0.30701.2350。

您可以通過展示ScheduleActionService的這個「操作指南」視頻來運行以驗證您是否擁有正確的位http://msdn.microsoft.com/en-us/hh369939

相關問題