标签: methodimplattribute

任何人都可以给我看一个MethodImplOptions.ForwardRef的例子

它在MSDN上看起来很酷:

指定声明方法,但其实现在别处提供.

所以我在控制台应用程序中尝试了它:

public class Program
{
    [MethodImplAttribute(MethodImplOptions.ForwardRef)]
    public static extern void Invoke();

    static void Main(string[] args)
    {
        Invoke();
        Console.Read();
    }
}
Run Code Online (Sandbox Code Playgroud)

那我现在该怎么办?我在哪里可以提供实施Program.Invoke

.net c# methodimplattribute external-methods

11
推荐指数
2
解决办法
1289
查看次数

标签 统计

.net ×1

c# ×1

external-methods ×1

methodimplattribute ×1