Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Debugging Managed Applications in Windows CE Devices

0.00/5 (No votes)
2 Jun 2011 1  
Debugging Managed applications in Windows CE devices without using ActiveSync.

Table of Contents

  1. Description
  2. Things to perform in the OS design side
  3. Things to perform in the application Side
  4. How to debug a managed application
  5. Observations
  6. References

I. Description

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.

  1. ConmanClient2.exe
  2. CMAccept.exe
  3. eDbgTL.dll
  4. TcpConnectionA.dll

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

  1. From the menu, select Debug, Start Debugging, after inserting a break point in the source code.
  2. Figure 5: Start Debugging options
  3. Select the Windows CE device and deploy the project to the device using the Deploy button.
  4. 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
  5. 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.
  6. Figure 8: Location of the deployed files as CAB files

V. Observations

  1. 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.
  2. Figure 9: Binaries in C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\target\wce600\armV4i
  3. 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:
    • 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

  4. Encountered debug issues:
  5. 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

VI. References

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here