Search code examples
c#uwpwindowsiotwindows-iot-core-10

How to use Iot.Device.Bindings nuget package on Windows uwp app?


I have Windows UWP foreground app running on my raspberry (windows 10 iot core). I want to use Iot.Device.Bindings nuget package to capture data from various sensors (e.g. bme680). But looks like this package is unsupported on UWP:

NU1202: Package Iot.Device.Bindings 1.2.0 is not compatible with uap10.0.17763 (UAP,Version=v10.0.17763). Package Iot.Device.Bindings 1.2.0 supports:
  - net5.0 (.NETCoreApp,Version=v5.0)

I tried to create backroung job for iot core, but same error. Can someone suggest approch how to achive that? Thanks in advance!


Solution

  • Yes, the Iot.Device.Bindings package does not support UWP on Windows IoT Core but works for .net core. Since the library uses APIs in namespace System.Decive.. For UWP app, you need to use APIs in namespace Windows.Device.. At the moment, I can not find a package which is implemented for various sensors. Here are two suggestion for that:

    1. Create a .net core app which uses the Iot.Device.Bindings nuget package, and build a channel to send the data from .net core app to your UWP app, such as tcp, or web API.
    2. Imeplement the library for UWP by referring the source code.