Pecker
Pecker

Reputation: 133

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.

Upvotes: 4

Views: 8116

Answers (2)

Tomas Dale
Tomas Dale

Reputation: 29

I resolved the issue after using in NuGet

Add-Migration Initial Update-Database

Upvotes: 1

Harshita Singh
Harshita Singh

Reputation: 4870

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.

Upvotes: 8

Related Questions