編譯器錯誤 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()
{
}
}