Prakhar Mishra
Prakhar Mishra

Reputation: 1814

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?

Upvotes: 5

Views: 1670

Answers (1)

Jeff S
Jeff S

Reputation: 7484

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?

Upvotes: 11

Related Questions