c# - How to disallow var keyword under .net 2.0 target? -
I have created a new project in Visual Studio 2.0 in Visual Studio. But even if I have left the var
keyword anywhere, then Visual Studio successfully compile the project. Is this the correct behavior that is the var
3.0 feature? Is there any setting to prevent code from being compiled to var
?
var
one C # 3.0 feature But it is not required Architecture Features In other words, it is perfectly ok to use within a project targeting. NET 2.0. It is also true about many other characteristics - anonymous type, automatic properties, lambda quote etc.
See me for more information. (I need to update it for C # 4 at some points ...)
If you want to to limit to C # 2.0, In the build tab of the "Advanced" project properties, IIRC (this is definitely somewhere else, but I just have a cup of coffee in comparison to the correct location.)
Comments
Post a Comment