Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeLoadException: Method 'Create' in type ... does not have an implementation (Error Below)

I published my program onto an Azure Website and this error arose:

enter image description here

The error only seems to occur when I try to add data to the connected Azure SQL Server, or pull (some of the) data from the Azure SQL Server. Could this be a dependency issue? If so, I'm using a netcoreapp3.1 with Microsoft.EntityFrameworkCore.SqlServer version 3.1.4. Here is a further screenshot of the other NuGet packages and their versions:

enter image description here

I've tried to look elsewhere to find a solution to this problem, but this seems to be a one-of-a-kind issue specific to my program. Let me know if any other information is needed as I'm not sure what this error is truly rooting from.

like image 919
Pecker Avatar asked Oct 20 '25 11:10

Pecker


2 Answers

Basically, the error message means that Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitorFactory type has a mention of Create method in your code/library, but it is unable to find it as there is a wrong version's reference of the nuget package in which Create method is not present.

Please note that all the following packages should be of same version:

  • Microsoft.EntityFrameworkCore.Tools
  • Microsoft.EntityFrameworkCore
  • Microsoft.AspNetCore.Identity.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.Design
  • Microsoft.EntityFrameworkCore.SqlServer

For example, all of these can be of 3.1.4 version. Check out exact same issue around this: I get an error when I add migration using Entity Framework Core

If this does not work, you might want to check out this solution.

like image 52
Harshita Singh Avatar answered Oct 22 '25 01:10

Harshita Singh


I resolved the issue after using in NuGet

Add-Migration Initial Update-Database

like image 41
Tomas Dale Avatar answered Oct 22 '25 01:10

Tomas Dale