Entity Framework Core: DbContextOptionsBuilder does not contain a definition for 'usesqlserver' and no extension method 'usesqlserver'

前端 未结 30 3203
星月不相逢
星月不相逢 2020-12-13 03:14

I am new to EF core and I\'m trying to get it to work with my ASP.NET Core project.

I get the above error in my startup.cs when trying configure the

30条回答
  •  遥遥无期
    2020-12-13 03:47

    For asp.net core version 2.1 make sure to add the following package to fix the problem. (At least this fix the issue using SQLite)

    dotnet add package Microsoft.EntityFrameworkCore.Sqlite
    dotnet add package Microsoft.EntityFrameworkCore.Design
    

    Here is the reference of the documentation using SQLite with entity framework core. https://docs.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite

提交回复
热议问题