C# .NET 3.0/3.5 features in 2.0 using Visual Studi

2019-01-17 17:23发布

What are some of the new features that can be used in .NET 2.0 that are specific to C# 3.0/3.5 after upgrading to Visual Studio 2008? Also, what are some of the features that aren't available?

Available

  • Lambdas
  • Extension methods (by declaring an empty System.Runtime.CompilerServices.ExtensionAttribute)
  • Automatic properties
  • Object initializers
  • Collection Initializers
  • LINQ to Objects (by implementing IEnumerable extension methods, see LinqBridge)

Not Available

  • Expression trees
  • WPF/Silverlight Libraries

7条回答
相关推荐>>
2楼-- · 2019-01-17 17:52

You can use Mono's version of the System.Core which fully supports LINQ & Expression Trees. I compiled its source against .net 2.0, and now I can use it in my .net2.0 projects. This is great for projects that needs to be deployed on win2k, where .net3.5 is not available.

查看更多
登录 后发表回答