コンパイラ エラー CS0133

'variable' に割り当てられる式は定数でなければなりません

const 変数は値として定数でない式を使用できません。 詳細については、「定数」を参照してください。

次の例では CS0133 が生成されます。

// CS0133.cs  
public class MyClass  
{  
   public const int i = c;   // CS0133, c is not constant  
   public static int c = i;  
   // try the following line instead  
   // public const int i = 6;  
  
   public static void Main()  
   {  
   }  
}