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.
The C# spec is developed separately from the CLR. This means that if a C# feature can be translated into code for an earlier version of .NET, it can still be used when targeting the earlier version of the framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With