编译器错误 CS0439
更新:2007 年 11 月
错误消息
外部别名声明必须位于命名空间中定义的所有其他元素之前
当 extern 声明位于同一命名空间中某些其他元素(如 using 声明)之后时会发生此错误。 extern 声明必须位于所有其他命名空间元素之前。
示例
下面的示例生成 CS0439:
// CS0439.cs
using System;
extern alias MyType; // CS0439
// To resolve the error, make the extern alias the first line in the file.
public class Test
{
public static void Main()
{
}
}