Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlLite [duplicate]

Project is .NetCore 2.2 Nuget Packages: * Microsoft.EntityFrameworkCore.Design (2.2.0) * Microsoft.EntityFrameworkCore.Sqlite (2.2.0) * Microsoft.EntityFrameworkCore.Tools (2.2.0)

Running Command:

Scaffold-DbContext "Data Source=blogging.db;" Microsoft.EntityFrameworkCore.Sqlite -OutputDir Models

Produces Error:

Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlLite. Ensure the specified name is correct and is referenced by the project.
like image 728
Post Impatica Avatar asked Feb 12 '19 19:02

Post Impatica


Video Answer


3 Answers

I was getting this error:

Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer. Ensure the specified name is correct and is referenced by the project.

I fixed it by adding this to the <ItemGroup> element in the project file.

<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.5" />
like image 90
FamilyMan802 Avatar answered Oct 16 '22 15:10

FamilyMan802


The fix as mentioned was to add the SQL framework. You can add it very quickly via the package manager console using:

Install-Package Microsoft.EntityFrameworkCore.SqlServer

like image 7
shhh-bacon Avatar answered Oct 16 '22 14:10

shhh-bacon


I solved this error by installing EntityFrameworkCore through nuget package manager. Also the project the EntityFrameworkCore packages installed, should be referred in the project you try to create models.

like image 2
Nantharupan Avatar answered Oct 16 '22 14:10

Nantharupan