NETMF doesn't exist

using GHIElectronics.NETMF.USBHost;

I just stated a new project to play with the USBHost module on the FEZ Spider, but I can’t get Visual Studio 10 to compile. It tells me that NETMF doesn’t exist in namespace GHIElectronics. I must have missed something, but I don’t know what. I have the latest software and firmware–non-beta. My old projects without the USBHost work. Can anyone help?

All the dll’s are there. I don’t know how to fix VS. The project is a Gadgeteer project. Do I have to manually do something in VS?

Did you create the project from scratch?

4.1 or 4.2?

Yes, new Gadgeteer project with Spider, USBClientDP, and USBHost.
NETMF Version 4.1

Did you install our package installer complete?

Yes, I didn’t get any errors.

If you are using gadgeteer project then all is added automatically. What are you trying to do?

I’m trying to attach a wireless or wired USB mouse to the spider and use the two buttons as inputs. But I can’t get past the compiler. As soon as I type NETMF in the using command, it turns red telling me that NETMF doesn’t exist.

using GHIElectronics.NETMF.USBHost;

I tried reinstalling the GHI libraries, but still get the error. I have another project using seeed stuff and Load module, and I don’t have any problems. It seems not to know what NETMF is. Is there a place or config file that I can check?

Have you added the assembly as a “reference” in Visual Studio?

How do you add that? I thought it was automatically added when the SDK is installed. If I go to the project properties in VS and add the assemblies directory, I still get the same error, except that the underline under NETMF is now blue instead of red.

When you install the SDK, it only makes the assemblies available. To use them within your project, you need to tell Visual Studio what you need. In the Solution Explorer within Visual Studio, right-click on the “References” folder and choose “Add Reference”. Pick the assembly you need.

Thank you. That did it. I wonder why it was not automatically added when I added the USBHost module. I had to add references to NETMF.USBHost and NETMF.System.

This may be related to a bug that I recently discovered in the Gadgeteer designer. If you added two USBHost modules and then removed one, it will remove the reference. There apparently isn’t a check being made to see how many dependencies there are before removing the drivers for a module.