How do you get a BLE Advertisment callback in a desktop .NET app?

丶灬走出姿态 提交于 2019-12-06 11:29:33

Just tried this out with a Console .NET 4.6.1 app and the advertisement callback is coming through. I wrote up a GitHub Sample of this a bit ago, which might help out. They key for getting WinRT APIs working are two references:

To use the WinRT APIs, add two references:

  1. C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd

  2. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll

It sounds like you may be missing the second reference. I was able to use the v4.5 .NetCore framework with 4.6.1.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!