'Error trying to scaffold Controller in ASP.NET Core 6 Web API - Visual Studio 2022
I have created a new ASP.NET Core 6 Web API project and I'm using an existing MYSQL database. I managed to scaffold models and context from the database without problems.
But when i try to scaffold controller, either when using the Add -> Controller -> API -> API Controller with actions, using Entity Framework (in solution explorer) or using dotnet-aspnet-codegenerator controller command in Package Manager Console i get the following error:

I have googled around for solutions but can't seem to find any.
I'm new to C#/Visual Studio/.NET/EntityFramework (I'm used to using node.js) so any help/suggestions are appreciated.
Solution 1:[1]
I had the same problem before with a lower version of EF Core caused by some kind of cs syntax , helping me install the package Microsoft.CodeAnalysis.CSharp.Workspaces . ?aybe your problem is the same and I hope this helps you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Darkk L |
