Trying to update a project to .NET 8.0. I updated all the related packages to match the 8.0 version.
But it throws System.MissingMethodException: Method not found: 'Void CoreTypeMappingParameters..ctor
at runtime.
I tried to check the migrations in cli but most of the commands give me this:
Unable to create a 'DbContext' of type ''. The exception 'Method not found: ...
dotnet ef dbcontext list
does recognize my context but it always throws the error.
I am using mysql. The packages related and their versions are :
- MySql.EntityFrameworkCore 8.0.0-preview
- MySql.Data 8.2.0
- Microsoft.EntityFrameworkCore 8.0.0
- Microsoft.EntityFrameworkCore.Relational 8.0.0
- Microsoft.EntityFrameworkCore.Design 8.0.0
- Microsoft.EntityFrameworkCore.Analyzers 8.0.0
My project works well on the 7.0 version. I did not modify anything except updating the packages in this new 8.0 branch.
2
Answers
There might have been something wrong with MySql.EntityFrameworkCore 8.0.0-preview
For now the only way to solve this should be switching to Pomelo.EntityFrameworkCore.MySql.
If your code works fine on the older version of .NET, the only line you need to change is where you call
UseMySql
.For .Net 8 Please use Pomelo.EntityFrameworkCore.Mysql version 8 and above.