Main Site Documentation

First Project



I am a beginner in Gadgeteer and NETMF programming. I have done a sample project (HelloLED) and try to execute but getting “System.NotSupportedException” error.

I have selected “Emulator” as Transport and “Microsoft Emulator” as Device. After searching the trouble shooting guide, I could found following:

Programs using GHI Hardware libraries and .NET Gadgeteer programs will not run on the NETMF emulator.

The most common error in these cases is:


Does this mean that I have to buy the hardware’s to run my application? Or is there any way i can test my application till I buy the hadware.

Thanks for your hlep



@ Ajith - The only way to use our library extensions (GHI.Networking, GHI.Hardware, and the others) is to buy the hardware. The emulator only functions with the core NETMF assemblies.


@ Ajith - you can use the emulator to do lots of things but it soon gets limiting as you have to code the emulator to simulate the your hardware.

Easiest way to do a test with the emulator is to use debug.print to write text back to the VS console. Or you can write text or graphics to the emulated LCD.


Hi John / Hagster

Thanks for your reply. If I want to run on debug mode, I am not sure what Transport and Device to be selected. I tried following code with Trasport as Emulator. However, I am unable to get to ProgramStarted as start of the project an Emulator will days followed by an exception.

Public Sub ProgramStarted()

        Debug.Print("Program Started")
        While (True)
            While (button.Pressed())
                Debug.Print("LED Onnnnnnnnnnnnnnnnnnnn....")
            End While
            Debug.Print("LED Offfffffffffff....")
        End While
    End Sub


Hi Ajith
I’m not familiar with VB so I’ve used C# and recoded your example.

        void ProgramStarted()
            Debug.Print("Program Started");
            button.ButtonPressed += button_ButtonPressed;
            button.ButtonReleased += button_ButtonReleased;

        void button_ButtonReleased(Button sender, Button.ButtonState state)
            Debug.Print("LED off");

        void button_ButtonPressed(Button sender, Button.ButtonState state)
            Debug.Print("LED on");

If you select your device as the transport and upload your program you will see the Debug.Print statements in the Output window.

We are registering two events for the button, one when pressed and another when released.

When the button is pressed the button.ButtonPressed event will fire turning on the led and printing “LED on” to the Output window.

When the button is released the button.ButtonReleased event will fire turning the led off and printing “LED off” to the Output window.

Hope this helps.


Use the formatting to make your code easier to read.

You really don’t want to be doing loops in the ProgramStarted() function either.

If you need a loop, create a thread in ProgrameStarted and then use that to do the loops.

Sprigo’s suggestion is also better.