Custom store WP8

I tried to create a custom contact store in WP8. My code (from msdn):

async public void AddContact(string remoteId, string givenName, string familyName, string email, string codeName) { ContactStore store = await ContactStore.CreateOrOpenAsync(); } private void Button_Click_1(object sender, RoutedEventArgs e) { AddContact("0", "Sample", "Sample", " sample@tut.by ", "32"); } 

When a button is clicked, a System.UnauthorizedAccessException appears: access is denied ..

I do not understand what's going on?

+4
source share
1 answer

Try adding ID_CAP_CONTACTS to the WMAppManifest.xml file in your project.

UnauthorizedAccessException is a general type of exception that is thrown when a manifest does not have a specific capability. We can only wonder why the guys at MS forgot to add such an important tip to the MSDN docs.

+4
source

Source: https://habr.com/ru/post/1444282/


All Articles