初級 › does not exist in the current context の原因と直し方 › パターン3
does not exist in the current context の原因と直し方
変数名のスペルミスやスコープ外参照で出る、初心者に最も身近なエラーの一つです。
1 class Program { 2 static int Square(int n) { return n * n; } 3 static void Main(string[] args) { 4 System.Console.WriteLine(______(4)); ^ 5 } 6 }
Program.cs(4,34): error CS0103: The name 'Squar' does not exist in the current context
空欄を埋めてビルドを通す
メソッド名のスペルミスです。定義したメソッド名と1文字でも違うと見つけられません。
次の問題