Extension Method in C# 2.0

前端 未结 4 730
小蘑菇
小蘑菇 2020-12-06 17:28

What namespace do I need to get my extension to work

Here is my Extension Method


using System;
using System.Collections.Generic;
using System.Web;
using          


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-06 18:19

    You can't. C# 2.0 doesn't have extension methods at all. You can use extension methods from C# 3.0 in Visual Studio 2008 targeting .NET 2.0 as described in my "C#/.NET versions" article but you can't persuade a C# 2.0 compiler to act as if it understands what extension methods are.

提交回复
热议问题