Advertisements
Home > Windows Phone > System.UnauthorizedAccessException – Windows Phone 8 application

System.UnauthorizedAccessException – Windows Phone 8 application

These days I started practicing windows phone 8 applications.
In my first application, I tried to call a number using Windows Phone Stack using below code.

WP 8 Phone DIaler

WP 8 Phone DIaler

PhoneCallTask phoneCallTask = new PhoneCallTask();

phoneCallTask.PhoneNumber = “1234567890”;

phoneCallTask.DisplayName = “Rajeev”;

phoneCallTask.Show();

While executing the code block I got below exception

An unhandled exception of type ‘System.UnauthorizedAccessException’ occurred in System.Windows.ni.dll

Access Denied WP8

Access Denied WP8

Fix

  • We have to enable ‘Phone Dialer’ capability in ‘WMAppManifest.xml’ file
  • In the Project ,open ‘WMAppManifest.xml’ file under ‘Properties’ folder
  • Go to ‘Capabilities’ tab and check ‘ID_CAP_PHONEDIALER’ check box.
WMAppManifest

WMAppManifest

App Manifest file

  • Each Windows Phone app has a manifest file that contains details about the app, such as the App ID and the capabilities that the app uses.
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: