我在页面加载事件中使用以下代码并在通道名称上获取异常。
HttpNotificationChannel pushChannel;
// The name of our push channel.
string channelName = "ToastSampleChannel";
pushChannel = HttpNotificationChannel.Find(channelName);
An exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.Phone.ni.dll but was not handled in user code
答案 0 :(得分:0)
在WMAppManifest中,您需要添加ID_CAP_PUSH_NOTIFICATION功能。
<Capabilities>
......
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
</Capabilities>