I am confused about this – I have .NET 3.5 on my machine and VS2008 – The servers all run .NET2.0
Can I compile code on my machine and target .NET3.5 and still run on the 2.0 CLR??
Is there a mtrix anywhere which highlights .net versions and CLR versions and their compatability?
How do I find out what CLR i am using??
This is a bit of a complex topic but here are the high points. The two main parts of the 3.5 framework are a set of libraries, most notably System.Core.dll, and a service pack to the CLR (2.0SP1).
You cannot safely compile applications against the 3.5 libraries and deploy them to a machine only running 2.0RTM. This will work in some circumstances, but it does so by sheer luck. Several features in the 3.5 framework rely on bug fixes included in 2.0SP1.
What you can safely do is use VS2008 to target the 2.0 runtime. This will give you most of the new language features while allowing you to safely deploy to 2.0RTM machines.