views:

151

answers:

3

One of the cool things about the .NET Compact Framework is that you can run .NETCF executables on the desktop version of Windows. However, there are minor incompatibilities between the platforms that have to be dealt with at run-time. My question is, how do I tell which platform I'm on right now?

+2  A: 
if(Environment.OSVersion.Platform == PlatformID.WinCE)
{}

I can tell you for a start you'll need this in some GDI+ and also any file access code.

Quibblesome
+1  A: 

This is a great question. Can you list off a few of the incompatibilities you have discovered?

NeboWiki
I've listed a few here: http://stackoverflow.com/questions/342576/do-you-know-any-run-time-differences-between-compact-and-full-framework-code feel free to add any if you got new ones.
Quibblesome
One I was dealing with was that System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase returns a URL-style string on the desktop but a normal path on WinCE.
Qwertie
+1  A: 

Here's a good article on the topic.

Write Code Once For Both Mobile And Desktop Apps

Phaedrus