Extension methods with .NET Micro Framework

偶尔善良 提交于 2020-01-02 08:19:29

问题


It seems that extensions methods are not supported/working with the .NET Micro Framework.

Is there any way to get this usefull language feature working?


回答1:


When you add the ExtensionAttribute class to your project you can use extension methods also in the .NET Micro Framework.

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


来源:https://stackoverflow.com/questions/14344668/extension-methods-with-net-micro-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!