【发布时间】:2013-08-03 16:59:40
【问题描述】:
我正在做 windows phone 上的推送通知教程。一开始推送通知没有问题。
然而,几天后我打开编码并得到这个错误:
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=UtemFtmkDB
StackTrace:
at UtemFtmkDB.MainPage.ButtonSave_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.<OnMouseLeftButtonUp>b__3()
InnerException:
在 App.xaml.cs 中:
private void AcquirePushChannel()
{
CurrentChannel = HttpNotificationChannel.Find("MyPushChannel");
if (CurrentChannel == null)
{
CurrentChannel = new HttpNotificationChannel("MyPushChannel");
CurrentChannel.Open();
CurrentChannel.BindToShellTile();
}
}
每当我从:App.CurrentChannel.ChannelUri.ToString() 检索数据时,我都会收到此错误。为什么?
【问题讨论】:
标签: azure push-notification azure-mobile-services mpns windows-phone-8