This article describes the steps required to create and deploy a simple “Hello, World” application in managed code (C#) using Microsoft Visual Studio 2008.
Prerequisites : Visual Studio 2008, Windows Mobile 6 SDK, Active Sync 4.5.
Create the Application
To create an application:
- Open Visual Studio. On the File menu, click New, and then click Project.
- In the New Project dialog, select Visual C#, Smart Device as the project type and select .NET Framework 3.5. Type in HelloWorld in the Name field and choose an appropriate location on your machine to store the project. Click OK.

- In the Add New Smart Device Project dialog, choose Windows Mobile 6 Professional SDK as the Target platform. Select Device Application from the templates provided. Click OK.

Note: You can also use the Windows Mobile 6 Standard SDK. The forms and emulator will display a Smart Phone instead of a Pocket PC, and there will be other differences, but the tutorial steps will otherwise be the same.
The Windows Forms Designer opens showing the Form1 form of the created project.

- Click the MainMenu1 control in the Windows Forms Designer. This enables you to edit the menu. Type “Quit” in the menu area on the form (it should say “Type Here”) and then type Enter.

- Double-click the word Quit to go to the message handler for the menu item, and add the following code:
private void menuItem1_Click(object sender, EventArgs e)
{
Application.Exit();
}
- Add the following code to the Form1 class.
protected override void OnPaint(PaintEventArgs e)
{
string drawString = "Hello World";
Font drawFont = new Font("Arial", 10, FontStyle.Regular);
SolidBrush drawBrush = new SolidBrush(Color.Black);
float x = 10.0F;
float y = 10.0F;
e.Graphics.DrawString(drawString, drawFont, drawBrush, x,y);
}
- Save all files (File > Save All).
- In the Visual Studio toolbar, in the Solutions Configuration list, select the Debug configuration. (This is selected by default.)
Build and Test
To build and test your application:
- In the Visual Studio Build menu, select Build Solution. Verify that the application builds without any compilation errors.
- From the Visual Studio Debug menu, select Start Debugging.
- In the Deploy HelloWorld dialog, choose Windows Mobile 6 Professional Emulatorand click Deploy.

The emulator screen opens. Note: It takes some time for the application to deploy on the emulator.

The Hello World application will then execute on the emulator, showing the following screen:

- Click Quit to close the application.
- Close the emulator window. Click Yes on the Device Emulator dialog to save the emulator settings. This speeds up the emulator startup on subsequent executions.

Deploy
To deploy your application to a phone:
- From the Visual Studio Solutions Configuration list, select Release configuration and build the solution.
- To deploy the application to your mobile device, connect the mobile device to an available USB port. In the Tools menu, select Connect to Device and choose Windows Mobile 6 Professional Device.

A series of warning messages are displayed on the mobile device. Press Accept on all the messages. If the connection is successful, the following dialog appears:

- In the Visual Studio toolbar, from the Target Device list, select Windows Mobile 6 Professional Device.
- In the Build menu, select Deploy Solution. The application is deployed to the connected Mobile device.
- In your device the Hello World program will be in the Program Files folder. Test it on the device.