views:

121

answers:

3

Is .NET Compact a perfect subset of .NET?

Can I write a Windows Forms application and run it on .NET Compact, assuming that I took into account screen size and other limitations and avoid classes and methods not supported by .NET Compact or is .NET Compact a different and incompatible GUI framework?

+3  A: 

No, but you can do the other way around; write a compact framework app and run it on the desktop. There may be some limitations that I am not aware of, but for simpler applications it works.

Fredrik Mörk
That's exactly what he was asking - he was asking if CF is a "perfect subset of .NET", which it (almost) is, with a couple of exceptions such as the one in my answer...
Reed Copsey
@Reed: I read it the other way around too since he says *"Can I write a Windows Forms application and run it on .NET Compact"* although his first question goes the other way.
Cory Charlton
Hrm... Yeah, I was going off the title + first sentence...
Reed Copsey
@Reed: yes, I was about to say, "yes, pretty much", but then I read the rest of the question (which was a somewhat unusual move, to be me; I tend to fast-forward a bit too fast at times), which lead to the answer I gave.
Fredrik Mörk
If .NET Compact is a subset of .NET it should be possible, logically, to write _a_ Windows Forms application that runs on both. That doesn't mean, or even imply, that _any_ Windows Forms application will run on both. Reed interpreted the question correctly.
Andrew J. Brehm
+6  A: 

Yes, for the most part, (especially in regards to Windows Forms) .NET CF is a subset of the standard .NET Framework.

... other limitations and avoid classes and methods not supported by .NET Compact ...

This is the main tricky portion. .NET CF doesn't support quite a bit of things in the framework.

There are a couple of obscure classes in the framework only supported on CF, such as the IrDA classes in networking, but otherwise, everything in .NET CF is supported in the standard distribution.

For details, see "Differences with the .NET Framework" on MSDN.

Reed Copsey
Question - why the downvotes?
Reed Copsey
Thanks. I'll dig into the differences. On the small picture you look as if you have a white beard.
Andrew J. Brehm
@Andrew: LOL! That's funny - good to know. It's my shirt, actually - that'd be a huge beard!
Reed Copsey
+1  A: 

the Compact Framework is not exactly a subset of the .Net framework, but close enough. Watch out for DataGrid, they are not the same as the DataGridView in 2.0 and 3.5, but much more like the DataGrid in 1.1 (which I hated).

David Brunelle