views:

1165

answers:

3

I am currently in the preparation phase for a new project that will be developed with .NET Compact Framework (2.0 or 3.5, we'll see) and will run on a custom Windows CE 6 hardware. There is, however, one thing I can't get to work:

Debugging seems to be possible only with a physical device or with the emulator. But when I just start the app from explorer, it runs happily on my desktop (because, of course, the CF is installed on my development machine. So, the actual question is:

How can I debug my .NET CF app on my desktop system with the app running on the desktop CF framework? Or is this not possible? If the latter, how should I do this? Create a non-CF project for debugging? I know I should debug on the device and that is essential for the back-end of the app, but the GUI can be debugged on the desktop. Since it's using OpenGL, it runs much faster than in the emulator (the device has OpenGL acceleration).

A: 

I know what you mean regarding slow performance of the emulator when debugging CF apps.

Unfortunately, I don't think this is possible out of the box. If you notice, the debugger in VS always checks what is your connected device in order to decide if your app should be deployed or not, depending on whether you have any changes since the last deploy.

If someone wants to debug in something other than the emulator or the device, they should try and put another "emulator" in that list, that maybe it is not the typical emulator, but the desktop itself. Unfortunately, I don't think this is possible.

Of course I am ready to be corrected by someone more experienced in CF development. I would be really interested if such a technique for debugging CF apps, exists!

Petros
In that case, I think I'll build a desktop project for debugging. The GUI will most likely be completely self-written with OpenGL. It's just strange because a CF app runs fine on the desktop. Maybe I should try to attach to a running CF process, even if that's not as cool as direct debugging.
OregonGhost
Yes, maybe attaching to a running CF process, would do the trick. If you have any success, please comment about it here? I interested in this.
Petros
Seems to actually work. I tested with a simple CF WinForms app. Manually attaching is not the most appealing thing, but that it works will certainly help :)
OregonGhost
+1  A: 

Generally I create 2 projects one for desktop and one for CF. The desktop version is a desktop exe that just references CF .dlls (this is fine). Obviously you'll need to push your main app into librarys and make your actual .exe just a very light wrapper (but this is quite nice design anyway)

It's not actually running on the CF but the FF so there are a few compatability issues you may notice in a difference of the implementations.

The other option is to use the debugging option in Visual Studio to "attach to process". That way you can run the app by double clicking and then just attach to that process.

Quibblesome
+1  A: 

Follow this guide by Daniel Moth to setup a "My Computer" deploy target:

"The Moth: Deploy to My Computer"

Then choose this as the deploy target for your Smart Device Project and press F5. Try to stay clear of any platform specific modules/methods etc.

There are a lot of great blog entries in mr Moth's blog if you are an Compact Framework developer.

FkYkko