Goal: Generate client code for the mobile application project, so you can develop the device application and test it on a Windows Mobile emulator.
- In the Device Application Designer toolbar, click the Verify icon
to verify the device application code. If there are errors, they display in the Problems view. Errors must be fixed before generating the code.
- Once you have verified the device application, in the Device Application Designer toolbar, click the Generate Device Application icon
.
The Generate Device Application Wizard launches.
- Accept the defaults and click Next.
- In the second page of the Generate Device Application Wizard, in Target Device, select Windows Mobile 5.0 Pocket PC SDK, and keep the defaults for the rest of the Code Generation settings.
- Expand the Advanced section and select Deploy to an Activesync connected device or emulator and accept the default entries for the other settings.
The Create a shortcut in Programs option is selected by default, and the shortcut name is automatically filled in.
- Click Start Device Emulator Manager if it is not already running.
- In the Device Emulator Manager, right-click Windows Mobile 5.0 Pocket PC R2 Emulator, and select Connect.
- Right-click the same emulator, and select Cradle.
The Synchronization Setup Wizard appears.
- In the Synchronization Setup Wizard, click Cancel.
ActiveSync connects to the device emulator.

- Configure the way the device emulator connects to the Internet:
- In the device emulator, select .
- Select the Connections tab, then click Connections.
- Select the Advanced tab, then click Select Networks.
- Under "Programs that automatically connect to the Internet should connect using," select My Work Network, then click OK.
- Click OK, then click X.
- In the device application code generation wizard, click Finish.
The code generation wizard verifies the code, checks for a connected device, and compiles the code in the specified location.