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
  • 115,091
  • 17
  • 196
  • 297

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
  • 216,225
  • 63
  • 350
  • 396
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
TheMightyX2Y
  • 1,473
  • 1
  • 16
  • 24