Search code examples
.netcompact-frameworkwindows-ceshared-librariescode-organization

Developing for mobile devices and desktop


I'm starting a new project. It will run on devices running Windows CE, Windows Mobile 6 and will also have a desktop version. The software will connect to some equipments through the serial port, using it's own protocol. Basically it will:

  • connect to the equipment
  • send and receive info
  • read and write binary files

These tasks will be shared between desktop and mobile devices. I've been searching the information I need, but I still have some doubts:

  1. If I create the solution targeting Windows CE devices, will it work with Windows Mobile 6 too?
  2. Creating a class library targeting Windows CE will give me any trouble on using it in the desktop version? (when I add a reference to that class library, my VS says that I could experience some unexpected results)
  3. Is it possible to install .NET CF 3.5 on devices running Windows CE 4.2?

Thanks!


Solution

    1. Maybe. Windows Mobile is Built on Windows CE, but it doesn't contain everything the OS has to offer. If you use a CE feature that WinMo does not have then no, it will not work. The same can be said about creating an application for WinMo - it may or may not run under Windows CE.
    2. CF assemblies are retargetable, meaning that the desktop framework can at least attempt to run them. They will run fine until you hit an issue where you cann something CE specific. For example, P/Invoking coredll, using a SIP control, using the MessageWindow class, etc. If you use classes common to both frameworks, it will be fine.
    3. Yes. You cannot debug directly on the device (well, you're not supposed to be able to but often you can get it to work by manually running corecon) but it will run just fine (assuming you have all of the OS components necessary to load the CF runtimes anyway).