ASP.NET Core Entity Framework Scaffolding Error Microsoft.EntityFrameworkCore.SqlServer

While creating MVC Controller using the scaffolding engine in Visual Studio, getting the following error

‘Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitorFactory’ from assembly ‘Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ does not have an implementation.

As per the error message, it means that the version being used doesn’t implement Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitorFactory’ method in 3.1.3.0

Solution –

Step 1: We need to check the version of EntityFrameworkCore

Microsoft.EntityFrameworkCore

Microsoft.AspNetCore.Identity.EntityFrameworkCore

Microsoft.EntityFrameworkCore.Design

Microsoft.EntityFrameworkCore.SqlServer

Microsoft.EntityFrameworkCore.Tools

Step 2: Include all the following packages above to be of the same version.

Step 3: Build the solution and check Scaffold

Step 4: If it’s not working then UnInstall the following packages

Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools

Step 5: Re-install the above package and build the solution and check

Step 6: if it’s not working then Uninstall the package Microsoft.visualStudio.Web.CodeGeneration.Design

Step 7: Build the solution then clean it and check Scaffold.

The above steps work most of the time, if it’s not working then check the dotnet version or upgrade it.

Happy Programming!!



Leave a Reply

Discover more from AI Infrastructure Architect & Enterprise Solution Architect

Subscribe now to keep reading and get access to the full archive.

Continue reading