C# NET微框架的扩展方法

C# NET微框架的扩展方法,c#,extension-methods,.net-micro-framework,C#,Extension Methods,.net Micro Framework,在.NET Micro Framework中,似乎不支持/不支持扩展方法 namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] public sealed class ExtensionAttribute : Attribute { } } 有没有办法让这个

在.NET Micro Framework中,似乎不支持/不支持扩展方法

namespace System.Runtime.CompilerServices
{
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
    public sealed class ExtensionAttribute : Attribute { }
}
有没有办法让这个有用的语言功能正常工作?

当您将类添加到项目中时,您也可以在.NET Micro Framework中使用扩展方法

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

更准确地说,扩展方法是一种编译器特性,它仅仅依赖于该属性的存在。