Why doesn't Windows Phone 7 fully support the C# specification when the only language available to it is C#? Okay, I can understand the lack of "dynamic" support, but why isn't contra-covariance supported? Why aren't third-party libraries that are familiar to us and that we use in server-desktop projects not compatible with the Phone 7? What's sense in an having an intermediate IL code if we still end up here?
Windows Phone 7 doesn't fully support all of the .NET Framework features you are used to because it is built on Silverlight.
Silverlight was designed to not support the full set of features because it is meant to be a light runtime (rather than requiring every user to download the entire .NET Framework to run a Silverlight appliction).
Bear in mind that it's running on the Compact Framework CLR - which doesn't have all the features of the desktop CLR.
EDIT: After a bit of trawling, I've found that generic variance isn't supported in the Compact Framework (or at least wasn't back in 2005, and I suspect it hasn't been implemented since as there's been little use until very recently):
No support for variance modifiers. Though variance/co-variance forms part of the overall ECMA spec for generics, and is implemented for the full .NET CLR, it is not used in Base Class Library or by C# and VB.
Okay, so it doesn't "fully support" C# 4 (the absolutely latest release), but do you know of any C# 3 language features which aren't supported?
In terms of libraries, you're dealing with a framework which is roughly based on Silverlight 3 but with some Silverlight 4 bits, and with various aspects of "desktop" Silverlight removed. (EDIT: According to a link in the comments, it should contain all of the APIs of Silverlight 3. I'm not sure whether that's accurate or not...) In other words, it's its own beast, really. Even though the IL itself may be portable, it's hard to give a guarantee of compatibility when various APIs have been removed. However, in many cases you can rebuild the libraries to target WP7. I agree it's annoying to have to do so, but it's better than them not being available at all.
EDIT: Citations for my claims that it uses the CF CLR:
Windows Phone 7 Series Developer General FAQ:
What technologies and tools can I use to program for Windows Phone 7 Series?
You can currently use the managed language C# using Silverlight and XNA based on Compact Framework.Can I use Windows Forms?
No, Windows Forms are not supported in the version of Compact Framework included with Windows Phone 7 Series.
(and later)
Can I use XNA library calls in Silverlight?
Silverlight and XNA share a common code base in the Compact Framework. If a call is not GUI based, in most cases it can be shared between Silverlight and XNA.
For the developers coming to Windows Phone 7 (WP7) from the Windows desktop let me first clarify that the runtime (CLR) that is running on the WP7 is not the same as the one running on the desktop. The WP7 runtime is known as .NET Compact Framework (NETCF) and it works differently than the “desktop CLR”.
if you're using SL, linking to a webservice, then you can (should) keep the mobile app skinny and suck the fat on the server...
sounds simple i know, but many peeps TRY to delegate all responsibilities to the 'app' - this is bad practice. if your 'website' is REST compliant, then you should align your app to purely making json/xml calls to your 'expensive' server based logic.
anyway, that's how we do it :)