I'm trying to get the device_id
in Windows Phone 8. I 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 the following exception:
An exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.Phone.ni.dll but was not handled in user code
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
How can I solve this issue?