Why are some C#4 features allowed even when targeting 3.5?
- by Greg
We upgraded to VS 2010, but we haven't yet upgraded to .NET 4.0. All of our projects are still explicitly targeting 3.5.
Today, a developer checked in code that looked like this:
delegate T Generator<out T>();
As far as I know, "in T" and "out T" are C# 4.0 features. According to our build server, which doesn't have .NET 4.0 installed on it, I'm right. The check-in broke the build. But, why the heck does it build on his machine? Why is VS just ignoring the target framework for the project?
Other C# 4.0 features, like the dynamic keyword, do not build on the developer's machine.