ContactManager.RequestStoreAsync() throws System.UnauthorizedAccessException

后端 未结 2 943
心在旅途
心在旅途 2020-12-21 12:24

I am trying to use the ContactManager class in the Windows 10 Universal apps API. I am trying to do this on a Windows 10 Desktop machine.

I am receiving an exception

相关标签:
2条回答
  • 2020-12-21 12:41

    As of 2018, there is such capability listed on Capabilities tab when visually editing the Package.appxmanifest, at least in VS2017. Anyway, the

    <uap:Capability Name="contacts" />
    

    is the crucial thing required in manifest.

    0 讨论(0)
  • 2020-12-21 12:50

    Alright, I think I discovered the answer on my own. Looks like if you add the "contacts" capability to the Package.appxmanifest file manually, it will fix the issue.

    There is no UI option for this capability. You have to somehow know it exists, edit the file in a text editor instead of in the UI, and add:

    <uap:Capability Name="contacts" />
    
    0 讨论(0)
提交回复
热议问题