dotnet / Scaffolding

Code generators to speed up development.
MIT License
644 stars 230 forks source link

No Code Generators found with the name controller. #2014

Open marcus-collab opened 2 years ago

marcus-collab commented 2 years ago

Hi Team.

Any help with the error mentioned above seen using .Web.ConGeneration.Design v 6.0.8

image

I've restarted vs, cleared the component cache, and deleted the .vs folder. Nothing seems to work.

This happens after I've added migration and updated the database using entity framework. I go ahead an add my DbSet within my data context.

public DbSet IFCProjects { get; set; }

I then go ahead and create a "API controller with actions, using Entity Framework" and get the following error.

image

Any help would be appreciated!

dannykhreet commented 2 years ago

did you fix it ?

deepchoudhery commented 2 years ago

@marcus-collab @dannykhreet Hey what version of VS are you running? We had fixed this issue in one of the earlier previews.

deepchoudhery commented 2 years ago

@marcus-collab @dannykhreet Need more info please.

yltsa commented 1 year ago

Hi, I have the same problem with the newest .NET 7.0. Is there any solution to fix tis?

PAGEHL commented 1 year ago

Hi, i have the same problem with VS2022 and .Net 6.0 with a hosted Blazor Wasm. With VS2019 and .Net 5.0 scaffolding a controller is no problem! Any solution?

deepchoudhery commented 1 year ago

This error usually occurs when there is a missing/corrupted/nefarious version of the Microsoft.VisualStudio.Web.CodeGenerators.Mvc. I would check in the default nuget path and delete that package, re-do the scaffolder and that should help. Let me know if that unblocks you all @PAGEHL @yltsa @dannykhreet

dougclavell commented 1 year ago

I am receiving the same error when attempting to scaffold controller with views. EF 7.0 All requisite NuGet packages installed, and all are 7.05 with the exception of the CodeGeneration packages (6 in all) If I make them all 7.05, I get a generic error. Project compiles just fine. Tried deleting bin and obj folders, cleaning and rebuilding the project. Removed and re-installed all NuGet packages. Verified the default NuGet path. Please see attached MS Word doc. EF_7.docx

dougclavell commented 1 year ago

P.S. I am using Visual Studio to scaffold - not the command line interface.