Deploying Applications to Hardware

You can deploy your .NET Micro Framework project to the hardware emulator included in this SDK or directly to your hardware by performing three main tasks.

Deploying With Visual Studio

Using Visual Studio, you can easily deploy your project either to the emulator or directly to your hardware. To do so, you must perform three tasks. First, you must set the deployment option in Visual Studio so that it deploys one project in your solution. Next, you must set that project as the start-up application. Finally, you must tell Visual Studio where you want your project deployed.

Selecting the Project to Deploy

The first step in configuring Visual Studio to deploy your project is to confirm that the deployment option is enabled for one and only one project in your solution. The following procedure explains how to do this.

  1. If your project isn't already open in Visual Studio, open it now.
  2. From the main menu, select Build and then Configuration Manager.
  3. In the Project contexts list, make sure that the Deploy check box is selected for the project you want to deploy and not selected for any other project.

You can only deploy one project at a time. If you try to deploy multiple projects in your Visual Studio solution at the same time, the last project to be deployed will overwrite all previous deployments. To help prevent the accidental deployment of multiple projects, only the first .NET Micro Framework project in a solution is marked as DEPLOY. All others are set to BUILD, so that they will be built but not deployed.

Conversely, if no projects are marked as DEPLOY, then Visual Studio will not deploy any applications to your device. You can build your application and enter debugging mode, but the code you will be debugging is whatever is already on the device because no new code was deployed. If you encounter this problem, you can solve it by using the preceding steps to mark a project as DEPLOY.

Setting the Startup Project

One of the projects in your solution must be a startup project; that is, it must contain the program's Main method. Before you deploy your program, you must set the project containing Main to be the startup project. To do this, use the following procedure.

  1. In the Solution Explorer window, locate the name of the startup project. Right-click the startup project, and then click Properties on the menu that appears.
  2. In the list on the left side of the Properties page, click Application.
  3. In the Startup object drop-down list, click the name of the class that contains the Main method.

Setting the Deployment Destination

Finally, you must tell Visual Studio where you want your program to be deployed. You can deploy it to the emulator or to one of the ports on your development computer. To configure this setting, use the following procedure.

  1. In the Solution Explorer window, locate the name of the startup project. Right-click the startup project, and then click Properties on the menu that appears.

  2. In the list on the left side of the Properties page, click Micro Framework.

  3. In the Transport drop-down list, click Emulator, Serial, Tcp/Ip, or USB.

  4. The information entered in Device depends on the selection that you made in the Transport list:

    • If Transport is set to Emulator, click the appropriate emulator in the drop-down list.

    • If Transport is set to Serial, click the appropriate COM port in the drop-down list.

    • If Transport is set to Tcp/Ip, manually enter the Internet Protocol (IP) address, using dotted-quad notation.

    • If Transport is set to USB, click the appropriate USB port in the drop-down list.

      Note

      Although serial ports are always shown in the Device drop-down list, USB ports are not displayed unless a device is attached.