Code Fix

初級type or namespace name could not be found の原因と直し方 › パターン1

type or namespace name could not be found の原因と直し方

List<T>やDictionary、StringBuilderなど、名前空間ごとに分かれたクラスを使うにはusingディレクティブが必要です。

 1  __________________________________
                     ^
 2  class Program {
 3      static void Main(string[] args) {
 4          List<int> nums = new List<int>();
 5          nums.Add(1);
 6          System.Console.WriteLine(nums.Count);
 7      }
 8  }
Program.cs(4,9): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)

空欄を埋めてビルドを通す

広告
広告スロット(未設定)

type or namespace name could not be found の原因と直し方

このエラーの解説と類題をまとめて見る →

広告
広告スロット(未設定)