Tag: methodimplattribute

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

它在MSDN上看起来很酷: 指定声明方法,但其实现在其他位置提供。 所以我在控制台应用程序中尝试了它: public class Program { [MethodImplAttribute(MethodImplOptions.ForwardRef)] public static extern void Invoke(); static void Main(string[] args) { Invoke(); Console.Read(); } } 那我现在该怎么办? 我在哪里可以提供Program.Invoke的实现?