I have created a new ASP.NET Core 6 Web API project and am using an existing MYSQL database. I successfully set up the model and context from the database without any issues.
But when I try to build the controller, either using Add-> Controller-> API -> API Controller and Action, using Entity Framework (in Solution Explorer) or in Package Management Using the dotnet-aspnet-codegenerator controller command in the controller console I receive the following error:
I googled 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/advice is greatly appreciated.
I have encountered the same problem before, because the low version of EF Core was caused by some cs syntax, helped me install the
Microsoft.CodeAnalysis.CSharp.Workspaces
package. Maybe your problem is the same, I hope this helps.