0

I keep getting this error when trying to add a scaffolded item to my presentation layer.

enter image description here

Packages I am using

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

It looks like scaffolding the items installing the older version of Microsoft.EntityFrameworkCore.SqlServer or Microsoft.EntityFrameworkCore then your project currently depends on.

There are several ways that might help you fix the said issue. You could try them one by one.

  1. Try to clear Nuget Cache.
  • Go to Tools in the Visual Studio
  • Options
  • NuGet Package Manager
  • General
  • Clear All NuGet Cache(s)
  1. If the issue persists, try to manually update the packages Microsoft.EntityFrameworkCore.SqlServer or Microsoft.EntityFrameworkCore

  2. Try to update the rest of the NuGet packages.

Reference: Package restore failed. Rolling back package changes

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • I tried to update them to a lower one to 3.1.19 and cleared the NuGet packages it still persists :( – Mariel Mifsud Apr 18 '22 at 16:29
  • If possible for you then for testing purposes, try to remove/uninstall `Microsoft.EntityFrameworkCore.SqlServer` and `Microsoft.EntityFrameworkCore` packages. Clear the NuGet package cache. Try to add a scaffolded item. see whether it adds the packages again without conflicting the versions of it. – Deepak-MSFT Apr 19 '22 at 01:35