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

前端 未结 7 1984
醉话见心
醉话见心 2020-12-09 05:27

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 tha

7条回答
  •  感动是毒
    2020-12-09 05:38

    To define extension methods, you'll need to supply the following class if you're targeting .NET 2.0:

    namespace System.Runtime.CompilerServices {
      [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
        sealed class ExtensionAttribute : Attribute { }
    }
    

提交回复
热议问题