0

I was following Entity framework tutorial in Microsoft.

https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application#main

Here I've done up to Set up EF to use a SQL Server Express LocalDB database.And in Creating a Student Controller and Views section when I tried to add a controller using MVC 5 Controller with Views, using Entity Framework (as mentioned in the tutorial), I'm getting an error saying

Attempting to install version '6.1.1' of 'EntityFramework' but the project already includes a different version. Skipping...

I tried reinstalling Entity Framework using the console, but still, it doesn't solve the problem. Does anyone know how to solve it?

3 Answers 3

3

Try to uninstall Entity Framework an then reinstall it

Uninstall-Package EntityFramework -Force

Install-Package EntityFramework

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

Comments

2

Run this command in Package manager console:

Uninstall-Package EntityFramework -Force

then close visual studio and delete entity framework floder in packages.config

again open Visual Studio and run this command:

Install-Package EntityFramework

Comments

0

Recently run into the same error.

Resolved it by uninstalling all the ef core packages through Nuget package manager and re-installing them with the latest stable version (5.0.9)

I have re-installed following ef core packages

  • EntityFrameworkCore
  • EntityFrameworkCore.SqlServer
  • EntityFrameworkCore.Design
  • EntityFrameworkCore.Tools

Note: Don't forget to rebuild the solution

See below screenshot

enter image description here

Comments

Your Answer

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