Home > Back-end >  How to get rid of Nuget package's Entity Framework error
How to get rid of Nuget package's Entity Framework error

Time:08-18

I have an ASP.NET MVC 5 project. It works fine, but every time I add a view (which successfully gets created) and then when I build solution I get error

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is packages\EntityFramework.6.4.4\build\EntityFramework.props.

I have to update (goes back to 6.1.3 version every time) Entity Framework which annoys me a lot. is there anything I can do to to solve this permanently?

Edit: here are all packages that uses targetframework=net472

<package id="Antlr" version="3.5.0.2" targetFramework="net472" />
<package id="bootstrap" version="3.3.4" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
<package id="FontAwesome" version="4.7.0" targetFramework="net472" />
<package id="jQuery" version="3.6.0" targetFramework="net472" />
<package id="jquery.datatables" version="1.10.15" targetFramework="net472" />
<package id="jQuery.UI.Combined" version="1.13.1" targetFramework="net472" />
<package id="jQuery.Validation" version="1.19.4" targetFramework="net472" />
<package id="Microsoft.AspNet.Mvc" version="5.2.9" targetFramework="net472" />
<package id="Microsoft.AspNet.Razor" version="3.2.9" targetFramework="net472" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net472" />
<package id="Microsoft.AspNet.WebPages" version="3.2.9" targetFramework="net472" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net472" />
<package id="Microsoft.jQuery.Unobtrusive.Ajax" version="3.1.2" targetFramework="net472" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.12" targetFramework="net472" />
<package id="Microsoft.Owin" version="4.2.2" targetFramework="net472" />
<package id="Microsoft.Web.Infrastructure" version="2.0.0" targetFramework="net472" />
<package id="Modernizr" version="2.8.3" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="Owin" version="1.0" targetFramework="net472" />
<package id="PasswordHashTool" version="1.0.0" targetFramework="net472" />
<package id="popper.js" version="1.16.1" targetFramework="net472" />
<package id="WebGrease" version="1.6.0" targetFramework="net472" />

CodePudding user response:

Try to make the following steps:

  1. Exit from the Visual Studio.
  2. Remove the EntityFramework... folder from the packages
  3. Remove <package id="EntityFramework" version="6.4.4" targetFramework="net472" /> line from the packages.config file using a text editor.
  4. Open the solution and add the required package EntityFramework.6.4.4 again using the NuGet Package Manager.

NOTE: Watch closely to the installation log. Probably you will see error related to the version conflict.

  • Related