.Net Compact Framework programs on a desktop OS?
Hi there,
I'm wondering if there is a CLR for .net Compact Framework for desktop OSs i.e. Windows XP? So that I can develop an application that runs on both mobile devices and a desktop machine? Or would I be restricted to running the .NCF application on a mobile device emulator?
If it can't be done, can applications be written with cross platforms in mind so that only a few classes are rewritten for a specific device and then different versions compiled for different platforms rather than rewriting things from scratch?
I get the impression that a CLR doesn't exist and that mobile apps are for mobile devices only; however some web searches are leaving me wondering so I thought I'd post for a definitive answer.
TIA!
[780 byte] By [
SFA_AOK] at [2007-11-11 8:29:47]

# 1 Re: .Net Compact Framework programs on a desktop OS?
As far as I know there is no other way to run a compact framework app on XP except with the emulator. What you could do is write the bulk of your code into a library and share it between the user interfaces for each.
# 2 Re: .Net Compact Framework programs on a desktop OS?
Yeah, that's what I was thinking but it's nice to know someone else thinks the same. Cheers :)
# 3 Re: .Net Compact Framework programs on a desktop OS?
What you can do iw write the bulk of your app targeted for the Mobile (CF) platform since the CF is, for the most part, a subset of the full .Net Framework (desktop).
What you will find is that your CF code will work for Desktop (as long as there is no mobile-specific stuff), but not always in reverse since the CF classes are much smaller.
So, put all non-UI code in a common set of modules which both applications can access. Then, create 2 separate UI's (one for mobile, one for desktop) which both access the common code. Build up the common code by working in the Mobile app so you only use the CF-available classes. Periodically check the common code by opening the desktop app and making sure there are no compile errors.
I have done this successfully for one of our products for which we have a desktop and mobile version available - it saves you a lot of time, plus the advantage of common code.
darren at 2007-11-11 21:49:24 >

# 4 Re: .Net Compact Framework programs on a desktop OS?
One last gotcha...
When sharing code between 2 projects: when you add the common code to a project (Project...add existing item), make sure you choose "Add as Link" from the Add button drop-down. Otherwise, the code is copied to your local project and is no longer shared between projects.
darren at 2007-11-11 21:50:24 >

# 5 Re: .Net Compact Framework programs on a desktop OS?
Hey Darren, thanks for the follow up, very useful info!