UnauthorizedAccessException or unhandled Exception when accessing Geolocator in Windows Phone

Published on July 6, 2013 by abundantcode

Filed under Windows Phone

Last modified July 6, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3793 times

When using the Geolocator GetGeopositionAsync () method, it is necessary to handle the necessary exceptions that may arise based on various scenarios. One such scenario is the Location is disabled by the use in the Phone Settings.

UnauthorizedAccessException or unhandled Exception when accessing Geolocator in Windows Phone

In this case, when the Geolocator’s GetGeopositionAsync() method is called, you will receive the UnauthorizedAccessException or unhandled Exception as shown below.

UnauthorizedAccessException or unhandled Exception when accessing Geolocator in Windows Phone

“An exception of type ‘System.Exception’ occurred in mscorlib.ni.dll but was not handled in user code

WinRT information: Your App does not have permission to access location data. Make sure you have defined ID_CAP_LOCATION in the application manifest and that on your phone, you have turned on location by checking Settings > Location.

If there is a handler for this exception, the program may be safely continued.”

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

There are times when you might get the following error when running the application from Visual Stud...

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specify...

How to add new user account from command line in Windows 10 ?

You can add a new user account in Windows 10 using command prompt using the net user command and pas...