csharper
csharper

Reputation: 263

Error while add migration to create database in Entity Framework 6, method not found CoreTypeMappingParameters

I'm trying to run add migration to create database on my local machine, in the last seconds I get this error:

Method not found: 'Void CoreTypeMappingParameters..ctor(System.Type, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, System.Func`3<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>)'.

Here is my Program.cs :

program.cs

I have no idea where to look, any suggestion?

Upvotes: 14

Views: 20714

Answers (4)

Ricky John Pragasam
Ricky John Pragasam

Reputation: 11

I also encountered the same issue, all your entityframeworkCore packages should have the same regardless of the version type. Now i installed all latest version now its working

Upvotes: 1

Andrew Production
Andrew Production

Reputation: 37

In my case in single project ASP.Net core .Net 6.0 I solved the issue by Installing Microsoft.EntityFrameworkCore version 6.0.14 instead of 7.0.3

Upvotes: 0

Rose Riyadh
Rose Riyadh

Reputation: 668

I found the solution for my problem based on the video in this article

click here

enter image description here

the solution is to make all the packages have the same version as Palemo.EntityFrameworkCore.MySql = 6.0.1 .

This made it work and create the migration for Mysql.

Upvotes: 31

csharper
csharper

Reputation: 263

If anyone has faced the same error, in your solution if you have different projects, check if the Microsoft Core version and tools versions are the same, removed them all re-installed the packages, the error is gone

Upvotes: 5

Related Questions