Access location in windows 10 (universal application)

2

I was trying to convert an old my project made for Windows phone 8.1 to a universal application for Windows 10, when I came across this error below.

The question is, how do I fix it? How do I request access to the location of a computer myself? , type sei la ... using IP allocation in the absence of a gps

  

An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.ni.dll but was not handled in user code

     

WinRT information: Your Application does not have permission to access location data. Make sure that ID_CAP_LOCATION is set in the application manifest on your phone if you enabled the location by selecting Settings > Location.

     

Additional information: Access is denied.

     

Your Application does not have permission to access location data. Make sure that ID_CAP_LOCATION is set in the application manifest on your phone if you enabled the location by selecting Settings > Location.

     

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

'

    
asked by anonymous 31.07.2015 / 01:21

1 answer

0

To provide access to the location in Windows 10 you must add DeviceCapability location in Package.appxmanifest

 <Capabilities>
   <Capability Name="internetClient" />
   <DeviceCapability Name="location" />
 </Capabilities>

Note : There is a script that can help migrate 8.1 apps to Universal Windows Platform. It is available at link

    
07.08.2015 / 10:33