Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在可移植类库上使用Band sdk_C#_.net_Portable Class Library_Microsoft Band - Fatal编程技术网

C# 在可移植类库上使用Band sdk

C# 在可移植类库上使用Band sdk,c#,.net,portable-class-library,microsoft-band,C#,.net,Portable Class Library,Microsoft Band,我正在开发一个针对通用Windows和.Net应用程序的可移植类库,我从NuGet安装了Microsoft.Band SDK,这解决了大多数频带符号: IBandInfo[] pairedBands = await BandClientManager.Instance.GetBandsAsync(); 已接受IBandInfo,但BandClientManager引发错误: The Name BandClientManager does not exist in the current con

我正在开发一个针对通用Windows和.Net应用程序的可移植类库,我从NuGet安装了Microsoft.Band SDK,这解决了大多数频带符号:

IBandInfo[] pairedBands = await BandClientManager.Instance.GetBandsAsync();
已接受IBandInfo,但BandClientManager引发错误:

The Name BandClientManager does not exist in the current context

这两个符号都来自SDK,任何原因一个被定义,而另一个未被解析?

BandClientManager
类型特定于使用Band SDK的平台(例如Windows Phone或Windows Store),部分原因是平台之间的蓝牙API存在差异。它不可移植,因此不能直接从面向多个平台的可移植类库中使用


相反,您需要将PCL中Band SDK的使用限制在可移植的
IBandClientManager
接口上。然后,特定于平台的库可以在运行时注入相应的
BandClientManager.Instance

由于平台之间蓝牙API的差异,
BandClientManager
类型特定于使用Band SDK的平台(例如Windows Phone或Windows Store)。它不可移植,因此不能直接从面向多个平台的可移植类库中使用


相反,您需要将PCL中Band SDK的使用限制在可移植的
IBandClientManager
接口上。然后,特定于平台的库可以在运行时注入相应的
BandClientManager.Instance

我们从哪里获得特定于平台的库版本?例如,可以在Linux上实例化
IBandClientManager
吗?我们从哪里获得特定于平台的库版本?例如,可以在Linux上实例化
IBandClientManager