3

when trying to get imei number null exception occurs. when running in windows phone emulator.

//Please check this

        object uniqueId;
        var hexString = string.Empty;
        if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueId))
            hexString = BitConverter.ToString((byte[])uniqueId).Replace("-",     string.Empty);
        MessageBox.Show("myDeviceID:" + hexString);
leppie
  • 112,162
  • 17
  • 191
  • 293

2 Answers2

3

I've had this issue with returning the null value.

In WMAppManifest.xml -> Capabilities tab -> switch on ID_CAP_IDENTITY_DEVICE
Sajeetharan
  • 203,447
  • 57
  • 330
  • 376
0

In this link, he used GetValue instead of TryGetValue and its working : Get Unique Device ID (UDID) under Windows Phone 8

Community
  • 1
  • 1
OhMyGeo
  • 1,407
  • 16
  • 23