Question

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?)

Était-ce utile?

La solution

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

Autres conseils

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.

Check that your project has been targeted for compatible bitness to the 32feet library. As of typing this, it's only available as a 32-bit DLL so make sure your project is targeted for x86 only. Visual Studio is too dumb to tell you about this.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top