Currently Being Moderated

Why ReSharper suggests using lambdas, vars and other new C# 3.0 language features for a project which has .NET Framework 2.0 set as the target framework?

VERSION 2

Created on: Jun 10, 2008 11:38 AM by Andrey Serebryansky - Last Modified:  Jan 28, 2009 3:53 PM by Andrey Serebryansky

     .NET Framework 3.5 still uses .NET 2.0 runtime, so C# 3.0 source code is actually compiled into .NET 2.0 IL. Visual Studio 2008 always uses C# 3.0 compiler disregarding the target framework selected, so you can actually use all the new C# 3.0 language features (except extension methods, which require certain attributes from .NET 3.5 Framework).

     You can still enforce the base language level ReSharper uses to check your code. In order to do so, select your project in Solution Explorer, open View > Properties Window (or press F4) and set the 'Language Level' property to a desired value.

Average User Rating
(6 ratings)




There are no comments on this document

More Like This

  • Retrieving data ...