Dustin Campbell (Did it with .Net) has an interesting post on leveraging Visual Studio 2008's mutli-targeting support to use C# 3.0 language features with .Net 2.0-targeted projects.
Visual Studio 2008's multi-targeting support for compiling projects to different versions of the .NET Framework is very powerful. Multi-targeting is a compelling feature because it enables users to continue working on solutions that target .NET Framework 2.0 and 3.0 while upgrading to the latest and greatest IDE. What isn't obvious is that all projects, regardless of target, are compiled with the C# 3.0 compiler. That means users can employ many of the new C# 3.0 language features in legacy projects. The only language features that can't be used are those that require library support from .NET Framework 3.5, in essence, LINQ, Expression Trees and Extension Methods. Implicitly-typed local variables, lambda expressions, auto-implemented properties, object and collection initializers, and anonymous types are all fair game. It's sort of like having C# 3.0-lite or C# 2.5.
Read more...
Be the first to rate this post
Tags: c#
Design / Technique | Tools / Services
I'm an Internet technology business strategist, software architect, and development leader specializing in interactive marketing and social media. read more...