简体   繁体   English

如何在 Windows ZD0836D7D5DBADA36AFEZ4应用程序上使用 Iot.Device.Bindings nuget package?

[英]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).我有 Windows UWP 在我的树莓派(Windows 10 物联网核心)上运行的前台应用程序。 I want to use Iot.Device.Bindings nuget package to capture data from various sensors (eg bme680).我想使用 Iot.Device.Bindings nuget package 从各种传感器(例如 bme680)捕获数据。 But looks like this package is unsupported on UWP:但看起来 package 在 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!提前致谢!

Yes, the Iot.Device.Bindings package does not support UWP on Windows IoT Core but works for .net core.是的,Iot.Device.Bindings package 不支持 Windows 物联网核心上的 UWP,但适用于 Z2D50972FECCD1762029。 Since the library uses APIs in namespace System.Decive.由于该库使用命名空间 System.Decive 中的 API。 . . For UWP app, you need to use APIs in namespace Windows.Device.对于 UWP 应用程序,您需要使用命名空间 Windows.Device 中的 API。 . . At the moment, I can not find a package which is implemented for various sensors.目前,我找不到适用于各种传感器的 package。 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. 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.参考源码实现UWP的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM