Visual Studio 2022 new Blazor server-side application .NET 9
I used EF Core Power Tools to import my SQL Server database as a DbContext and model classes.
I used the UI in VS2022 for Add/New Scaffolded Item, Common/Blazor/Razor Component, "Razor Components using Entity Framework (CRUD)" to create a set of CRUD pages for my first model class that was imported from the database. That worked fine. I got my Create, Delete, Details, Edit, and Index pages, which worked.
After futzing around with those pages for a day or two, I went to scaffold pages for my next model class.
I attempted multiple times and it would always run for a bit and then eventually display an error dialog that included the message "No code generators found with the name 'blazor'".
I searched the Web. I found similar reports. I tried all the suggestions.
From the command line, I uninstalled and reinstalled and updated dotnet-aspnet-codegenerator.
I ran the CLI command dotnet aspnet-codegenerator --help. It returned "No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference".
I DID already have Microsoft.VisualStudio.Web.CodeGeneration.Design in my project. I removed it, saved, rebuilt, added it back, tried again. Same results.
My presumption is that the error message from trying to scaffold in the UI in VS2022 is a result of the same issue I get from the CLI. I.e. for some reason, dotnet can no longer find its code generators.
Why is this happening?