Debugging a .NET Micro Framework Program

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The .NET Micro Framework enables you debug your device’s application code just as you would a desktop application. For example, you can set breakpoints and watches in your device’s application.

The HelloWorld solution uses the emulator as its target device. This program functions as it would on an actual device; the device performs its normal functions as you debug it. For example, if your device controls external motors, you will see the motors activate or deactivate as directed by your application.

Setting Breakpoints and Watching Variables

  1. In the HelloWorld solution, in Program.cs, click the left margin of the line:

    text.TextContent = "Hello, World";
    

    A red dot appears on the left margin of the line. The line is highlighted in red.

  2. Press F5. The program executes to the breakpoint and then pauses, after a few seconds. The line is highlighted in yellow.

  3. Right-click the word "text" in the highlighted line, and then click Add Watch. In the Watch window, a text node appears.

  4. In the Watch window, expand the text node, to see TextContent. The node expands after a few seconds and the value of TextContent is shown as null.

  5. Press F10 to step to the next line. After a few seconds, in the Watch window, the variable's value changes to "Hello, World".