Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EntityFramework 6.1.3: The type 'IdentityDbContext<>' is defined in an assembly that is not referenced

I am working on a project in net45. In solution, I have two projects. One is a MVC webapp (using EF) and other is a service (using DBContext defined in webapp). The strange part is, I can compile my webapp without any problems, but when I Rebuild my service project, I get this error:

The type 'IdentityDbContext<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I am referencing same EF version of library as I am in my webapp. Can anybody please tell me how can I resolve this?

like image 412
Prakhar Mishra Avatar asked Aug 16 '16 20:08

Prakhar Mishra


1 Answers

That class isn't part of EntityFramework, it's part of Identity.EntityFrame‌​work (NuGet package Microsoft.AspNet.Ide‌​ntity.EntityFramework‌​). Do you have that referenced in your service project?

like image 68
Jeff Siver Avatar answered Oct 23 '22 22:10

Jeff Siver