Search code examples
c#asp.net-coreasp.net-identityasp.net-core-identity

Issue adding IdentityDbContext


I am using Asp Net core 3 and trying to add identity core. When I add IdentityDbContext it gives error and if I change IdentityDbContext to DbContext error is gone. The same issue is when I try to add SQL sever using IdentityDbContext but no error when using DbContext. I am getting the following error "There is no implicit reference conversion from IdentityDbContext to Microsoft.EntityFrameworkCore.DbContext" .Click to view error I added the following NuGet package Microsoft.AspNetCore.Identity.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Sqlserver. Kindly help.


Solution

  • Put your cursor on IdentityDbContext and press F12, ...

    I navigated to IdentityDbContext class, its empty nothing in that class.

    That means that you have accidentally created that class through Intellisense. Look at where it is located: in your project, not the library.

    Find that class in your project and remove it. Then fix whatever references/usings the Startup class needs.