Cant use controller scafolding o my .net project, Error:"there was an error running the selected code generator package restore failed"

24 views Asked by At

Im trying to create my controllers using scaffolding, but Im getting the error "there was an error running the selected code generator package restore failed".

All my EF packages are at the same version, I already cleared the nugget cache but it didn't work.

See my packages: enter image description here

and my configuration to create: enter image description here

can someone help me?

1

There are 1 answers

0
Md Farid Uddin Kiron On

Im trying to create my controllers using scaffolding, but Im getting the error "there was an error running the selected code generator package restore failed".

Well, according to your description, its very hard to point the exact solution. Even though your EF packages seem aligned, there might be conflicts with other dependencies. Try updating all NuGet packages in your solution.

In order to do that, Open Manage NuGet Packages for Solution, and Click on Update All Packages.

On the other hand, sometimes, specific packages might cause issues with scaffolding. Try temporarily disabling Entity Framework or other potentially conflicting packages and see if the scaffolding works. Re-enable them one by one to identify the problematic packages.

Most importantly, make sure your project's .NET version is compatible with the versions of the scaffolding tools you're using. Check the documentation for the specific code generator you're trying to use.

enter image description here

Note: Please refer to this official document to scaffold the controller accordingly.