Use (certain) lambda expressions when targeting .NET 2.0?

后端 未结 2 1416
青春惊慌失措
青春惊慌失措 2020-12-20 21:09

ReSharper suggests we change:

System.Net.ServicePointManager.ServerCertificateValidationCallback +=
    delegate(object sender, X509Certificate certificate,          


        
相关标签:
2条回答
  • 2020-12-20 21:32

    You should choose which of them you prefer the most. In C# 3.0 all features introduced (such as Lambda expression, extension methods and LINQ) are build on the 2.0 .NET runtime. So you can develop using C#3.0 and run it on the 2.0 of the runtime.

    As long as your compiler can handle C#3.0 you can use all the new C#3.0 features. The only exception I know of is that if you use Expression trees you'd need to use .NET 2.0 SP1 because some of the bug fixes in the CLR for that service pack is needed to make expression trees work properly.

    0 讨论(0)
  • 2020-12-20 21:32

    You can use it as long as you use VS2008 (or later) for development. Lambda expressions is a feature of C# language, it's not a feature of .Net Framework.

    0 讨论(0)
提交回复
热议问题