Developing for .NET Compact Framework, without Visual Studio

If you own a Pocket PC device, or any Windows Mobile based device (i.e. PDA phone) and you know how to code, you start feeling the urge to develop for it. The possibilities seem endless: highly portable, natural (touch screen) interface, integrated mobile communications (Bluetooth, Wi-Fi, GPRS, 3G, you-name-it), camera, GPS… it’s all there, ready to be combined in fun ways.

Now that you want to use your skills to that end, this seems impossible without spending big bucks on Microsoft’s Visual Studio (I assume you don’t use pirated software, right?). The Express editions are fine for small to medium sized desktop apps, but there’s no support for .NET Compact Framework. You are stuck, right?

Well, actually, not exactly.

If you own a Pocket PC device, or any Windows Mobile based device (i.e. PDA phone) and you know how to code, you start feeling the urge to develop for it. The possibilities seem endless: highly portable, natural (touch screen) interface, integrated mobile communications (Bluetooth, Wi-Fi, GPRS, 3G, you-name-it), camera, GPS… it’s all there, ready to be combined in fun ways.

Now that you want to use your skills to that end, this seems impossible without spending big bucks on Microsoft’s Visual Studio (I assume you don’t use pirated software, right?). The Express editions are fine for small to medium sized desktop apps, but there’s no support for .NET Compact Framework. You are stuck, right?

Well, actually, not exactly.

There is always SharpDevelop, an Open Source alternative to Visual Studio which – even though less muscular than its multi-hundred-dollar rival – can be used to develop real-world applications, even targeting .NET CF! It supports Boo, C# and VB.NET languages out of the box. The interface looks a lot like VS, so newcomers will not have too much of a hard time.

In order to develop for the Compact Framework, you need a few extras, thankfully available for free from Microsoft. You actually need the .NET CF SDK, but I found it is much more rewarding downloading the Windows Mobile 6 SDK Refresh from their site. It is a somewhat large download (almost 0,5Gb), but it includes all the latest advancements in .NET CF, including the interop with Pocket Outlook (full messaging support) and the camera interop. Not every capability of the devices is mapped into .NET yet – notably most of wireless communications functions – but it is better than nothing.

Does this mean that this is the ultimate solution? Not at all. Using a preliminary release of a feature found in an Open Source app has its disadvantages. For one, you don’t get deployment to the device or the emulator upon hitting the Run button; it will open it as a normal .NET app on your desktop! The forms have to be not resized, or they won’t fit on the device’s screen. You have to make the forms maximized, otherwise they end up as windowed apps, which is very annoying. Sometimes (read: most of the times) the GUI designer will inject lines of code incompatible with .NET CF into the designer source file that you have to edit out yourself. There is no support for building an installer or CAB file; you have to do that yourself.

As a bottom line, while it is possible to develop for .NET CF without Visual Studio, such a setup is only relevant for hobbyists or one-man-companies who want to test their skills on developing .NET CF apps without paying for the full VS in advance. Probably in the future the .NET CD support in SharpDevelop will be better. But even until then I continue to enjoy developing small utilities. The really fun part is coding, after all smile_regular.

Published by Nicholas Dionysopoulos

PHP developer, author of Akeeba Backup and Admin Tools. Father, husband, cat herder and geek. Proudly uses all major Operating Systems on desktop and mobile.