dotnet-presentations/aspnetcore-app-workshop

Scaffolding as described in the section "Create BackEnd API project" ends with error

holecekp opened this issue · 1 comments

I have tried the first section "Create BackEnd API project". However, when I scaffold the API controller using Visual Studio, it fails with the following error:

Method 'Create' in type 'Microsoft.EntityFramework.Core.SqlServer.Query.Internal.SqlServerTranslatingExpressionVisitorFactory' ... does not have implementation.

aspnetworkshoperror

I have tried to solve this by updating all nugets. However, there is problem with Microsoft.VisualStudio.Web.CodeGeneration.Design (5.0.2). The latest version is not compatible wit .NET Core 3.1. So I tried to uninstall the package and install version 3.1.5 instead. The scaffolding still does not work. This time, it fails with error:

aspnetworkshoperror2

I do not know if the problem is with the instructions in this workshop, in some of the Nuget packages, or in the scaffolding in Visual Studio. Maybe specific versions of Nugets are required. It is sad when such basic things does not work out of the box. I have tried scaffolding for API controllers in .NET framework and some older versions of .NET Core and it worked without problems that time.

I am using Visual Studio 2019 (version 16.9.4).

I have fixed this by changing version to .NET 5 and updating all Nugets to the latest version.