When using the code generators for scaffolded items in Visual Studio 2019 Version 16.8.5 I get the error message:
*There was an error running the selected code generator: 'Package restore failed. Rolling back package for PROJECT
I've seen so many devs facing the same issue here on Stack Overflow, but the suggested solutions doesn't work for me. Here are an example project from Pluralsight with the issue.
- Clone: https://github.com/bjorkblom/.NETCORE
- Create a folder named api in OdeToFood/Pages
- Right click on the folder and select "Add -> New scaffolded item..."
- Choose "API Controller with actions using Entity Framework"
- Model Class: Restaurant (OdeToFood.Core)
- Data context class: OdeToFoodDbContext (OdeToFood.Data)
- Controller name: RestaurantsController
- Click "Add" and you'll get the error message.
I've tried to downgrade both the project and entityframework to 3.1 and 2.1. Nothing is working.