Click here to Skip to main content
15,998,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
 I am new to Asp.net Core. 
I have installed Entity FrameWork Package into my solution using the Nuget package. When I run the update-database command, I get the following error. 

Your project does not contain reference for EntityFramework. Ensure your target project is correct, install the package and try again.



This is my .csproj file
<itemgroup>
<packagereference include="EntityFramework" version="6.4.4">


What I have tried:

I've installed the Entity Framework package with the latest version..
Posted
Updated 18-Sep-20 2:41am

1 solution

That's not Entity Framework Core; that's Entity Framework 6 being used in an ASP.NET Core application. It should work, but the recommendation is to use Entity Framework Core for all new projects.

To use EF Core, you'll need references to Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools. The latest released version for both is 3.1.8.
 
Share this answer
 
Comments
Member 14872744 18-Sep-20 9:05am    
Thanks for the reply I havent installed Microsoft.EntityFrameworkCore.Tools package
Member 14872744 19-Sep-20 5:54am    
Now, that I have installed all the necessary packages, when i run the command update-database in my package manager console, it still throws error stating Your project does not contain reference for EntityFramework. Ensure your target project is correct, install the package and try again.
Richard Deeming 21-Sep-20 5:41am    
Make sure you've selected the default project in the drop-down list in the package manager console, and set the startup project to the one which contains the migrations.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900