find and solve || findandsolve.com
Please wait.....

Package restore failed. Rolling back package changes

Package restore failed. Rolling back package changes

There was an error running the seslected coe generator:Package restore failed. Rolling back package changes for <MyProject>.There does not appear to be any indication of what the error was.How can I solve this Error?Error: There was an error running the selected code generator:'package restore failed.Problem. When I tried to run npm install, it gave me this error. error code .

Always got this error when scaffolding suddenly “there was an error running the selected code generator package restore failed”

Why get error when trying to add controller and new scaaffolded item, ASP.NET MVC, VS 2019?.

I try to add controller and a new scaffolded item but I have got the following error: There was an error running the selected code generator:

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

Answer


Option 1.

Need to clear the NuGet Cache.

  1. Go to Tools
  2. Options
  3. NuGet Package Manager
  4. General
  5. Clear All NuGet Cache(s)

Option 2.

<PropertyGroup>
   <TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

Option 3.

Delete ".vs" folder from your solution directory. After reopening solution, execute a "Clean Soluiton" - that worked for me in VS2019, MVC .NET 4.7.2.

Option 4.

I managed to fix the problem by doing an update of all packages to the latest version (3.1.4 for the ones mentioned above).

Option 5.

Needed to update all already installed Nuget packages and then it started working.

Option 6.

bring the version of the solution package to 1.1.3 nuget package Version 1.1.3


Related information

Sundar  Neupane

Sundar Neupane

I like working on projects with a team that cares about creating beautiful and usable interfaces.

If findandsolve.com felt valuable to you, feel free to share it.

Comments



Report Response