Click here to Skip to main content
15,860,972 members
Articles / Mobile Apps / Windows Mobile

Debugging Managed Applications in Windows CE Devices

Rate me:
Please Sign up or sign in to vote.
4.67/5 (3 votes)
2 Jun 2011CPOL3 min read 47.5K   11   9
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.

Image 1

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.

Image 2

Figure 2: Tools Options tab

Navigate to the Devices option and click the Properties button.

Image 3

Figure 3: Tools Options Properties tab

Configure TCP Connect Transport by clicking the Configure button.

Image 4

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. Image 5

    Figure 5: Start Debugging options
  3. Select the Windows CE device and deploy the project to the device using the Deploy button.
  4. Image 6

    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.

    Image 7

    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. Image 8

    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. Image 9

    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:

    Image 10

    Figure 10: Communication lost Error CMAccept Timeout

    Image 11

    Figure 11: Connection or deployment not proper

VI. References

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionwindows mobile smart device application Pin
Member 93559715-Feb-13 23:11
Member 93559715-Feb-13 23:11 
GeneralNot valid win32 this file Pin
Htun Lin Aung3-Aug-11 0:40
Htun Lin Aung3-Aug-11 0:40 
GeneralRe: Not valid win32 this file Pin
Sreekesh NK6-Aug-11 0:13
Sreekesh NK6-Aug-11 0:13 
Sorry I didnt got what you actually need?
Can you explain a bit more?
Which Version of WinCE you are using?
From which OS are you trying to run these executables and for What?
QuestionDebugging Applications for Windows CE 7 Pin
Member 811710127-Jul-11 8:16
Member 811710127-Jul-11 8:16 
AnswerRe: Debugging Applications for Windows CE 7 Pin
Sreekesh NK29-Jul-11 0:31
Sreekesh NK29-Jul-11 0:31 
GeneralRe: Debugging Applications for Windows CE 7 Pin
Member 811710129-Jul-11 2:36
Member 811710129-Jul-11 2:36 
GeneralRe: Debugging Applications for Windows CE 7 Pin
Sreekesh NK3-Aug-11 0:12
Sreekesh NK3-Aug-11 0:12 
GeneralRe: Debugging Applications for Windows CE 7 Pin
Member 81171013-Aug-11 2:29
Member 81171013-Aug-11 2:29 
GeneralRe: Debugging Applications for Windows CE 7 Pin
Sreekesh NK6-Aug-11 0:07
Sreekesh NK6-Aug-11 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.