The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
Table of Contents
- Things to perform in the OS design side
- Things to perform in the application Side
- How to debug a managed application
This document describes how to debug .NET applications in Windows CE devices without using ActiveSync. The myth is that the SDK is required for debugging Managed .NET applications on Windows CE devices. But in reality, the SDK is not really required.
II. Things to perform in the OS design side
Once the image has been successfully downloaded from the platform builder to the device, copy the following binaries to the Debug/Release shared folder of the device.
The files can be found here: C:\Program Files\Common Files\Microsoft Shared\CoreCon\1.0\target\wce400\armv4i.
Figure 1: ConmanClient2.exe and CMAccept.exe path
To enable communication, run ConmanClient2.exe. After ensuring ConmanClient2.exe is up and running, run CMAccept.exe.
Note: After running CMAccept.exe you should switch to the debugging IDE and start debugging in a short span of time, else the connection won’t be established. If you are unable to connect or a deploy failure occurs, then re-run CMAccept.exe and try to debug again.
III. Things to perform in the application side
In order to debug a .NET application developed in VS 2005 or VS 2008 in Windows CE, the following settings have to be updated in the Visual Studio IDE.
Navigate to Visual Studio 2005 or 2008 IDE, from the Tools menu, take the Options tab as displayed below.
Figure 2: Tools Options tab
Navigate to the Devices option and click the Properties button.
Figure 3: Tools Options Properties tab
Configure TCP Connect Transport by clicking the Configure button.
Figure 4: Dialog to configure IP address
Select the option Use specific IP address and type the Windows CE device IP address and click OK, as shown in the above figure.
IV. How to debug a managed application
In order to debug managed applications, first ensure that ConmanClient2.exe and CMAccept.exe are running in the device.
Steps to debug
- From the menu, select Debug, Start Debugging, after inserting a break point in the source code.
Figure 5: Start Debugging options
- Select the Windows CE device and deploy the project to the device using the Deploy button.
Figure 6: Deploy dialog
The deploy status can be viewed in the status bar of the IDE at the bottom as shown in the figure below. Deploying will consume some time depending on the device.
Figure 7: Deploy status
- The deployment is done as CAB files and can be viewed in the following location: C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\windowsce\diagnostics.
Figure 8: Location of the deployed files as CAB files
- While deploying the application from the VS2008 or VS2005 IDE, initially the OS Design Editor pops up a dialog prompting to set the path of any of the below displayed binaries. These binaries are available at: C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\target\wce600\armV4i.
Figure 9: Binaries in C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\target\wce600\armV4i
- When debugging starts, the OS design prompts for edm2.exe. The user has to browse the folder where edm2.exe resides in order to proceed with debugging. edm2.exe can be obtained from two locations:
Encountered debug issues:
- For Visual Studio 2005 applications
C:\Program Files\Microsoft Visual Studio 8\SmartDevices\Debugger\target\wce400\armv4i
- For Visual Studio 2008 applications
C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\Debugger\target\wce400\armv4i
Below are some of the issues that occur due to connection failures:
Figure 10: Communication lost Error CMAccept Timeout
Figure 11: Connection or deployment not proper