C# 「非ジェネリック 種類 ‘IEnumerable’ は型引数と一緒には使用できません。 」が発生した場合の対処法
C#で、「非ジェネリック 種類 ‘IEnumerable’ は型引数と一緒には使用できません。 」が発生した場合の対処法を記述してます。
環境
- OS windows10 pro 64bit
- VSCODE 1.56.2
- .NET Core 3.1.409
エラー全文
以下のコードで発生
using System.Collections;
namespace Book.Services
{
public interface IBookService{
IEnumerable<int> GetBooks();
}
}
対処法
「System.Collections.Generic」を使用する
using System.Collections.Generic;
namespace Book.Services
{
public interface IBookService{
IEnumerable<int> GetBooks();
}
}
-
前の記事
php gmp_perfect_squareで平方根であるかを判定する 2021.12.11
-
次の記事
Linux カーネルパラメーターを確認する 2021.12.11
コメントを書く