Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no implicit reference conversion from ApplicationDbContext to Microsoft.EntityFrameworkCore.DbContext

While following the tutorial, I am getting an error when DbContextOptions<ApplicationDbContext> which is ApplicationDbContext inherit to IdentityDbContext but when I tried to inherit DbContext it works fine.

Error Screen Shot:
Error Screen Shot

Exception message:

The type 'WebExtractorPortalCore.Context.ApplicationDbContext' cannot be used as type parameter 'TContext' in the generic type or method 'DbContextOptions'. There is no implicit reference conversion from 'WebExtractorPortalCore.Context.ApplicationDbContext' to 'Microsoft.EntityFrameworkCore.DbContext'.

like image 556
klitz Avatar asked Oct 29 '25 00:10

klitz


1 Answers

For a perfect answer I need more information but form the error image you seem to be mixing ASP.Net packages and ASP.NETCore packages.

You have referenced Microsoft.EntityFrameworkCore which is a .net core package but then referenced Microsoft.AspNet.Identity.EntityFramework which is a .net (not core) package.

Remove the later package and reference Microsoft.AspNetCore.Identity.EntityFrameworkCore instead and it should work

like image 189
Ihusaan Ahmed Avatar answered Oct 30 '25 17:10

Ihusaan Ahmed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!