我正在尝试使用 C# 创建一个适用于 Windows 10 的经典桌面应用程序,它将能够与 BLE 设备通信。 我按照说明 ( Bluetooth 4.0 (low energy) API for windows desktop C# application ) 将标签添加到项目文件中
<TargetPlatformVersion>10.0.10156</TargetPlatformVersion>
并重新加载项目。我只能访问 Windows namespace :references dialog
我不知道我在其中一个测试中做了什么,但是一旦该列表填充了大量其他命名空间,我就能够检查 Windows.Devices 命名空间,这对我的项目至关重要。 我现在可以通过最近选项添加 Windows.Devices,但不能添加任何其他 namespace ...
你们知道我应该怎么做才能访问所有 Windows.x.y 命名空间的列表吗?
最佳答案
要从 .NET Framework 代码访问 Windows.Devices
和其他 WinRT API,
- 将 NuGet 包
Microsoft.Windows.SDK.Contracts
添加到项目中 - 配置项目以支持包引用(右键单击
packages.config
,选择 Migrate packages.config to PackageReference...)
关于c# - 桌面 C# - 引用 Windows.Devices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37496244/