c# - UnauthorizedAccessException in Microsoft.Phone.ni.dll -


i'm trying device_id in windows phone 8. tried doing this:

byte[] mydeviceid = (byte[])microsoft.phone.info.deviceextendedproperties.getvalue("deviceuniqueid"); string deviceidasstring = convert.tobase64string(mydeviceid); 

and this:

deviceextendedproperties.getvalue("deviceuniqueid").tostring(); 

both resulted in following exception:

an exception of type 'system.unauthorizedaccessexception' occurred in microsoft.phone.ni.dll not handled in user code

additional information: access denied. (exception hresult: 0x80070005 (e_accessdenied))

how can solve issue?

you need add required capabilities in app manifest file. particularly, try add capability :

id_cap_identity_device 

for reference :


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -