我最近下载了32Feet.NET库,用于在C#中使用蓝牙无线电设备。
当我尝试运行32feet库设置文件中包含的示例程序时,会出现以下错误信息:
Error 1:找不到'The type or namespace name 'InTheHand''(是否缺少using指令或程序集引用?)
https://32feet.codeplex.com/wikipage?title=Referencing%20the%20library
说:
引用库
该库作为一个名为InTheHand.Net.Personal.dll的程序集提供。安装程序会安排它可以直接从Visual Studio的添加引用对话框中进行选择。
注意:最近版本的许多库仅作为ZIP文件提供,不包含安装脚本/程序;它们不会将库添加到.NET选项卡中,因此您需要“浏览”磁盘上的库。
[...]
与标准网络库中的类一样,32feet.NET库中的类位于许多命名空间中。因此,需要一个或多个Imports(VB) / using(C#)指令。例如:
Imports InTheHand.Net // e.g. BluetoothAddress, BluetoothEndPoint etc
Imports InTheHand.Net.Sockets // e.g. BluetoothDeviceInfo, BluetoothClient, BluetoothListener
Imports InTheHand.Net.Bluetooth // e.g. BluetoothService, BluetoothRadio
检查您的项目是否针对32feet库进行了兼容位处理。截至目前,该库仅作为32位DLL可用,因此请确保您的项目仅针对x86进行了定位。Visual Studio无法提醒您这一点。
InTheHand
的引用,并且在代码中有using InTheHand
。using InTheHand
。