System.NotSupportedException - GHI.OSHW.Hardware.dll - FEZ Cerb40

@ BenL - welcome to the community.

Can you please start a new thread with your question?

@ Gus - Your reference about this known issue says “You can safely ignore this exception.”

Clicking ignore every time is a bit of a pain. Do you know of anyway that I can auto-ignore? e.g. catch it and ignore it, or tell Visual Studio not to reprompt every time?

Thanks in advance :slight_smile:

On my machine, I only see this in output window, there is nothing to click. Can you please explain your setup and steps?

Gus, thank you for your quick response. I have a very basic setup, VS Express 2010 running on 64-Bit Windows 7, and configured for a Cerbuino mainboard.

As you can see in the attached image, the exception does make it into the Output window, but it also pops up the visible dialog box … 3 times in a row :frowning:

Not sure what more I can tell you about my ‘setup’ … but happy to answer specific questions :slight_smile:

Tx.

@ JackN - I might be wrong, but based on the debug window output it looks like you are running against the emulator. Check the project properties to confirm that you are deploying to the physical device.

@ taylorza - Good catch :slight_smile:

@ taylorza - I am running against the emulator on purpose. Your comment suggests that the dialog will go away when I switch to the Cerbuino. If that is the case I am OK with this limitation. Big thanks.

You can’t use the emulator, most of the things you use are “not supported” and seeing that exception will be very normal.

The emulator is only good for built in filesystem, networking and maybe graphics. Most users do not use the emulator.

Thanks for the advice. I am knew to the Fez and from the documentation it wasn’t obvious to me that the emulator should be avoided :slight_smile:

This library that he is mentioning: using GHI.OSHW.Hardware;

It does not appear in my list of available references. Where is it, or how is it installed?

It seems critical for calling pins on this device.

@ Jockey4her - Include the OSHW reference for your board. it will contain the hardware namespace.

this allows a program to work with different boards without changing the Code, only the reference.

That library OSHW reference, does not appear in the list of available References to add.

Is there some installer missing?

If you install the current SDK from http://www.ghielectronics.com/support/.net-micro-framework then you will have it. More likely you have missed out adding the reference. Can you talk us through how you created the new project? All you need to do is to open VS, select MicroFramework, Console application, then add the reference to GHI.OSHW.
Hardware.

Sure Brett, thanks.

Open VS2012 for Win Desktop.
New Project -> MicroFramework Console Application C#
Right Click under Solution Explorer->References->AddReference.

No GHI.OSHW, or any GHI prefix items are listed there. The attached picture is all I see.
This is after installing the GHI OSHW NETMF v4.2 SDK successfully.

Things I’ve tried:
If search the Programs(x86) for GHI.OSHW*.dll, I see them listed in /assemblies inside the GHI sdk install area. I manually browsed and added FEZCerb, Hardware, and Native.
I then added the using for all three. (see 2nd picture).

Now the first example doesn’t really do anything with the hardware. So if I try the 2nd example wich starts to create input and output ports, these two items:
OutputPort LED;
InputPort Button;

show up as no namespace. As do things like FEZCerberus.

Not sure what to do. Not that it matters but if I try to download to the device, it just says Waiting to Initialize…

I know why :slight_smile: you need to retarget your project to netmf 4.2

We will update the docs

Nicely Done, Gus. That’s it.

Now… let’s see if I can’t get this device to respond!

Thanks again.