更新:2007 年 11 月
錯誤訊息
'static type': 靜態類別不能實作介面
介面可能在物件上定義非靜態方法,因此不能由靜態類別實作。若要解決這個錯誤,請確定您的類別不會嘗試實作任何介面。
範例
下列範例會產生 CS0714:
// CS0714.cs
interface I
{
}
public static class C : I // CS0714
{
public static void Main()
{
}
}
更新:2007 年 11 月
'static type': 靜態類別不能實作介面
介面可能在物件上定義非靜態方法,因此不能由靜態類別實作。若要解決這個錯誤,請確定您的類別不會嘗試實作任何介面。
下列範例會產生 CS0714:
// CS0714.cs
interface I
{
}
public static class C : I // CS0714
{
public static void Main()
{
}
}