0

We have a Desktop Windows app using some UWP Bluetooth LE UWP functions. We start the watcher:

string BTLEDeviceWatcherAQSString = "(System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\")";
string[] props = { "System.Devices.Aep.DeviceAddress", "System.Devices.Aep.IsConnected", "System.Devices.Aep.Bluetooth.Le.IsConnectable"};
watcher = DeviceInformation.CreateWatcher(BTLEDeviceWatcherAQSString, props, DeviceInformationKind.AssociationEndpoint);

It runs OK on most machines, just rarely we have an anonymized error log:

System.Exception: Element not found. Property key syntax error. A property key must either be specified as a canonical property name (preferred) or be of the form {fmtid} pid.
at Windows.Devices.Enumeration.DeviceInformation.CreateWatcher(String aqsFilter, IEnumerable`1 additionalProperties, DeviceInformationKind kind) 

We run this code for Windows 10.0.15063 (i.e. 1703) or higher, so all properties should be available by doc.

What may cause this error? Some HW configuration or Windows 10 settings?

xmedeko
  • 7,336
  • 6
  • 55
  • 85
  • If you create a pure UWP project to test this function, if you still face this issue? – Xie Steven Dec 11 '18 at 05:53
  • @XavierXie-MSFT I have no access to a machine where the problem occurs. Our app is publicly available for download and sends anonymized crash reports. Unfortunately, no user has contacted us so far with this problem. – xmedeko Dec 11 '18 at 11:36
  • If so, it's really hard to diagnose this issue. We even didn't know your user's environment. I suggested that you could try to enrich your log info report. You could try to add the system version, system architecture etc into your error log report. It would be helpful to you to reproduce the issue. See the [UWP Community Toolkit SystemInformation helper class](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/Helpers/SystemInformation.cs) to get these information. – Xie Steven Dec 18 '18 at 07:12
  • Or you could also use [Crash Reporting for UWP](https://support.hockeyapp.net/kb/client-integration-windows-and-windows-phone/crash-reporting-for-uwp) to help you diagnose this issue. – Xie Steven Dec 18 '18 at 07:12
  • @XavierXie-MSFT we have Destkop app, not UWP. I have already added `try .. catch` code to our next version and maybe we will get more info. Maybe some broken Windows installation? _It would be nice_ to have property name in the error message and maybe `ArgumentException` instead of plain `Exception`. – xmedeko Dec 18 '18 at 08:21

1 Answers1

1

I have seen this exception in a windows WPF desktop application. The reason was that I had neglected to detect the revision of Windows 10 was greater than version 1703 AKA creators edition. Therefore anyone running the application on an earlier version of Windows 10 would see this error. Its unfortunate that the error is so obscure, a not supported error would be better.

DerekGn
  • 614
  • 4
  • 3
  • We do not allow to run our app on an earlier version of Windows 10 1703. We use [`AnalyticsInfo.VersionInfo.DeviceFamilyVersion`](https://stackoverflow.com/a/31895625/254109) to detect the version. – xmedeko Apr 15 '19 at 10:30