2012-02-01 75 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

相关问题