问题描述
使用来自 MSDN 的以下教程,我正在尝试检索联系人.但是获取拒绝访问异常.快速入门:选择用户联系人 Windows Phone 商店应用
Using following tutorial from MSDN i am trying to retrieve contacts. But getting Access denied exception. Quickstart: Selecting user contacts Windows Phone Store app
PS:我使用的是 Windows Phone 8.1 通用应用.
PS: I am using windows phone 8.1 universal app.
我在以下行遇到异常
ContactStore contactStore = await ContactManager.RequestStoreAsync();
以下是异常堆栈跟踪
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()在 App3.Members.d__0.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at App3.Members.d__0.MoveNext()
推荐答案
查看 ContactStore 类文档中的要求部分 ContactStore 类的文档.
Check the Requirements section in the documentation of ContactStore class documentation of ContactStore class.
编辑 WMAppManifest.xaml 并添加 ID_CAP_CONTACTS
功能.
Edit WMAppManifest.xaml and add ID_CAP_CONTACTS
capability.
这篇关于调用 Windows Phone 8.1 ContactManager.RequestStoreAsync() 时访问被拒绝异常;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!