Automatic Properties Work in .NET 2.0
This was sort of an accidental discovery, I'm not the first to stumble on it, but it doesn't seem to be widely known. A colleague of mine asked me about an interesting behavior he noticed after switching to Visual Studio 2008. He was still targeting the .NET 2.0 framework, but noticed the automatic property feature worked.
Automatic properties are where you can just say
public string SomeProperty { get; set; }
The compiler provides the backing field and implements the get and set for you. It's a very nice shorthand syntax for a common pattern. We were all under the impression that it was a new C# 3.0 language feature and could only be used if you targeted version 3.5 of the .NET Framework. After searching around for why it was still working on a .NET 2.0 app, I found many who verified what we were seeing. Indeed it does work, because it's a compiler feature, and 2008 uses the latest compiler even if you are targeting 2.0. Cool.