1

I have one class library (.net standard) named 'DataLayer' and one web API project in the solution.

After right click on DataLayer and going on manage nuget package, when I try to install entity framework, it is giving an error message:

Package restore failed. Rolling back package changes for 'DataLayer'

I have already tried clear all nuget cache.

But the error still the same. what should I do?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Mars111
  • 21
  • 6
  • Try closing Visual Studio, packages should be restored when it’s reopened.. Also check packages.config for correct versions, in output window enable all errors, check for missing references in the bin.. – boateng Sep 17 '18 at 19:01
  • Package EntityFramework 6.2.0 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package EntityFramework 6.2.0 supports: - net40 (.NETFramework,Version=v4.0) - net45 (.NETFramework,Version=v4.5) One or more packages are incompatible with .NETStandard,Version=v1.4. Package restore failed. Rolling back package changes for 'DataLayer' – Mars111 Sep 17 '18 at 19:05
  • Need to figure out combining .NetStandard and .Net framework https://social.msdn.microsoft.com/Forums/vstudio/en-US/7035edc6-97fc-49ee-8eee-2fa4d040a63b/what-are-differences-between-net-framwork-net-standard-and-net-core?forum=clr – boateng Sep 17 '18 at 19:13
  • so i need to upgrade the framework ? – Mars111 Sep 17 '18 at 19:22
  • Not sure but here it says you should use .Net Core with .NetStandard for compatibility reasons.. https://stackoverflow.com/q/48582603/3254405 – boateng Sep 17 '18 at 19:31
  • ok, now i've created .net core class library and tried to install entity framework again but still same error 'package restore failed' Package EntityFramework 6.2.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package EntityFramework 6.2.0 supports: - net40 (.NETFramework,Version=v4.0) - net45 (.NETFramework,Version=v4.5) – Mars111 Sep 17 '18 at 19:37
  • Do you have to use EF6? It’s the one causing the error.. Try EF Core.. – boateng Sep 17 '18 at 19:39
  • Installing Microsoft.EntityFrameworkCore 2.1.3. Package Microsoft.EntityFrameworkCore 2.1.3 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.EntityFrameworkCore 2.1.3 supports: netstandard2.0 (.NETStandard,Version=v2.0) One or more packages are incompatible with .NETCoreApp,Version=v1.1. – Mars111 Sep 17 '18 at 19:44
  • Hm, at this time you should upgrade.. From .NetStandard 1.4 to 2.0 (but no guarantees).. – boateng Sep 17 '18 at 19:47
  • okay, thanks a lot :) – Mars111 Sep 17 '18 at 19:48

0 Answers0