none
AccessDenied when calling PairAsync running as service RRS feed

  • Question

  • I have a windows service running as central application. In my eventhandler for advertisements I have the following code:

    device = await BluetoothLEDevice.FromBluetoothAddressAsync(eventArgs.BluetoothAddress);            
    if (device == null)            
    {                
                  return;            
    }            device.DeviceInformation.Pairing.Custom.PairingRequested +=                        (ss, ev) =>                        
    {                            
                 ev.Accept();                        
    };            
    DevicePairingProtectionLevel protectionLevel = DevicePairingProtectionLevel.None;            
    var result = await device.DeviceInformation.Pairing.Custom.PairAsync(DevicePairingKinds.ConfirmOnly, protectionLevel);
    Log.Debug($"Pairing Result: {result.Status}");
    The result is always AccessDenied, though it should have been fixed in the Insider Preview (16257.1): https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/c6bd5e95-2ea9-48b8-a320-f3c9ab560ad6/pairing-ble-devices-from-a-service?forum=windowsgeneraldevelopmentissues

    Is there a workaround to overcome this issue or will there be a fix in the next time?

    Regards,

    Frank

    Monday, August 14, 2017 5:50 AM