Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth library in C#

I recently downloaded 32Feet.NET library to work with Bluetooth Radio Device in C#. When i tried to run a sample program included with 32feet library set up file i am getting this error message

Error 1 The type or namespace name 'InTheHand' could not be found (are you missing a using directive or an assembly reference?)

like image 823
Alam Avatar asked Sep 18 '13 13:09

Alam


2 Answers

https://32feet.codeplex.com/wikipage?title=Referencing%20the%20library

Says:

Referencing the Library

The library is provided as an assembly with name InTheHand.Net.Personal.dll. The installer arranges that it can be selected directly from Visual Studio’s Add Reference dialog.

Note: Many of the recent version of the library were provided as ZIP files alone and don't included an installer script/program; they do not add the library to the .NET tab, instead you'll need to "Browse" to the library on disk.

[...]

Like the classes in the standard network library, the library classes in 32feet.NET are in a number of namespaces. One or more Imports (VB) / using (C#) directives will thus be required. For example:

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
like image 190
alanjmcf Avatar answered Sep 27 '22 15:09

alanjmcf


check that you have the reference to InTheHand and that you have a using InTheHand on the code.

[EDIT]

1) see that you have the using InTheHand in the top of your code.

2) if a wiggly red line appear under the line it means you need to reference a library where the name-space is.

3) Normally the name-space and the name of the file match, this sometimes is not the case and on this cases you need to check the documentation, but first try and on the project right click and select "Add Reference" then in "Assemblies" try to find the name-space or the name of the library you are using, if you cant find it try on Assemblies->Extensions, if you steel cant find it then you try the DLL and to do this you chose the "Browse" and the path is the path you downloaded the file.

PS: when you install a new Library you need to restart your visual studio to let it load the new assemblies, most times restarting the machine is not needed but it cant harm.

like image 38
Pedro.The.Kid Avatar answered Sep 27 '22 15:09

Pedro.The.Kid