DEV Community

FOLASAYO SAMUEL OLAYEMI
FOLASAYO SAMUEL OLAYEMI

Posted on

Visual Studio 2022 Add New Scaffold Item 'There was an error running the selected code generator'

In Visual Studio 2022, the following error message is sometimes generated when scaffolding a controller:

Error Screenshot

If the .NET Framework project and item templates are not installed, the error mentioned earlier will occur.

How to address the problem:

  • Run the Visual Studio Installer

  • Select Modify

  • In the right-side tab expand ASP.NET and web development

  • Check .Net Framework project and item templates

Where to find .Net Framework project and item templates

Note: If the error reoccur, update the NuGet packages installed, then re-try the scaffolding.

Thanks for reading...
Happy Coding!

Top comments (0)