LoginSignup
1
0

More than 3 years have passed since last update.

DbContextOptionsBuilderに”UseSqlite”が含まれていませんと言われた時の対処法

Posted at

ASP.NET Coreのチュートリアルをこなしている最中に以下のようなコンパイルエラーが
発生した。

’DbContextOptionsBuilder' does not contain a definition for 'UseSqlite' and no accessible extension method 'UseSqlite' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly reference?)

どうやら、'UseSqlite'とやらが’DbContextOptionsBuilder'に含まれていないとのが原因らしい。

対処法

対処方法は単純で、含まれていないのなら、インストールすれば良いとのことで、
ターミナルを開いて、以下のコマンドを実行するれなよい。

    dotnet add package Microsoft.EntityFrameworkCore.Sqlite

この状態でコンパイルをかけると問題なくコンパイルに成功した。

動作環境

 OS : macOS Ver.10.15.17
 エディタ:VScode

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0