Reputation: 4469
I've just created a Web API application for .Net 4.5 to do some tests with Unity (IoC framework)*.
I've added Unity using Nuget:
Install-Package Unity
Then I've added Mvc5 support
Install-Package Unity.Mvc5
For the backend, I created a class project with an EF model in it, with minimal content. I registered it like this:
container.RegisterType<MyEntities>();
To do a basic process test, I added a repository and registered it like so:
container.RegisterType<IMyRepository, MyRepository>();
As far as I can tell everything is up and running, but when I execute, I get the notification that the Web API misses a reference to EF 5.
So I try add it like this:
Install-Package EntityFramework -Version 5.0.0
But then I get this error:
Unable to resolve dependencies. 'EntityFramework 5.0.0' is not compatible with 'Microsoft.AspNet.Identity.EntityFramework 1.0.0 constraint
The Microsoft.AspNet.Identity.EntityFramework
reference was added during Web API project creation and it's (strangely) actually version 2.0!
I want to leave the project as is, because I think the above reference is for authentication? And I will be needing that at some point.
Any ideas on how to fix this?
Upvotes: 0
Views: 2939
Reputation: 1058
Asp Identity Entity Framework 2 has dependency to Entity Framework version 6.0.1 and above.
Update your entity framework to latest version and then try your code.
Update-Package EntityFramework -version 6.1.3
Upvotes: 1