Error while trying to build a controller in ASP.NET Core 6 Web API - Visual Studio 2022
P粉006977956
P粉006977956 2024-02-25 14:41:18
0
1
398

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.

P粉006977956
P粉006977956

reply all(1)
P粉111627787

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template