10

I am using Visual Studio 2022 with.Net 6.0, I installed Entity Framework 6.4.4 after adding it when I create an Entity Framework model. I am getting a Popup message saying that.

The project's target framework does not contain Entity Framework runtime assemblies. Please review the target framework information on the project's property page.

Can somebody tell us how to solve that problem? enter image description here

9
  • 4
    You are using Entity Framework 6.4.4 you should be using Entity Framework Core 6.0.1 Commented Jan 3, 2022 at 12:04
  • Sir, I used that too but it's not working keep saying with the same popup message. (Microsoft.EntityFrameworkCore 6.0.1) Commented Jan 4, 2022 at 5:27
  • 1
    No, you are not, because Entity Framework Core doesn’t have the ability to add Entity Model, the way you do it. Entity Framework Core only supports code first approach. eg. learn.microsoft.com/en-us/ef/core/modeling Commented Jan 4, 2022 at 6:54
  • Sir can you tell me step by step procedure 1. New Projects-->Console Application-->install Package from NugetPackage Manager 2. Entity Framework anyone from this v(6.4.4),v(6.1.3), core 3. Solution explorer select project right click add item 4. New Item data-->Ado.net Entity Data Model Commented Jan 5, 2022 at 6:17
  • 3
    Step 3 and 4 should NOT be used at all, when you want to use .net 6, because as I said it prior it is unsupported, as you figured it out yourself, if you want to use this, for whatever reasoning, you will have to use .net framework 4.x and not .net 5.x or .net 6.x. BUT I would strongly recommend to not go this path, use .net 6.x and use Entity Framework Core 6.0.1, and write the models yourself in the so called code first approach. DO NOT USE THE USER INTERFACE to create the model, WRITE THE CODE YOURSELF. Commented Jan 5, 2022 at 10:41

3 Answers 3

3

You can install .Net Framework 4.8.

.Net Core 1 - 3.2 & .Net 5 & 6 has no Entity Framework Data Model available with EF Core.

You want to use EF 6 (not Core) and Data Model you have to use .Net Framework 4.8 or lower than that.

Sign up to request clarification or add additional context in comments.

1 Comment

Entity Framework Visual Designer msawczyn.github.io/EFDesigner/index.html Entity Framework Visual Editor Entity Framework visual editor for EF6, EFCore and beyond. marketplace.visualstudio.com/….
2

Ensure you have Target Framework as show.

enter image description here

Comments

2

Try this to generate/update entire DbContext and models:

Scaffold-DbContext -Connection "Server=(local);Database=DefenderRRCart;Integrated Security=True;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir RRStoreContext.Models -context RRStoreContext -Project RR.DataAccess -force

See this post for more info. https://stackoverflow.com/a/41413291/4588756

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.