我尝试运行 Marketplace 测试工具包,但它在能力验证中失败,Microsoft.Advertising.Mobile.dll 试图进行一系列调用。这是可以理解的,但我绝不会尝试从 BackgroundAgent 更新 AdControl。我能想到的最接近的事情是:
public ScheduledAgent()
{
if (!_classInitialized)
{
_classInitialized = true;
// Subscribe to the managed exception handler
Deployment.Current.Dispatcher.BeginInvoke(delegate
{
Application.Current.UnhandledException += ScheduledAgent_UnhandledException;
});
}
}
Application.Current 调用是试图参与广告控制吗?如果是这样,我该如何防止它这样做?
编辑:这是错误消息之一的输出:
Unsupported API cannot be used by a background agent. Assembly Microsoft.Advertising.Mobile.dll was trying to use Microsoft.Phone.Tasks.PhoneCallTask::.ctor.