Problems with using Mysql database as EntityFrameworkCore (EFcore) in net core 3.1

Article Directory



problem:

When using mysql's official file package to MySql.Data.EntityFrameworkCoredo mapping, errors are always reported, either version compatible or always reported. Anyway, there is a problem with the migration.

Later, I checked the information and found that many online said it was because of the official nuget package of Mysql, which was not supported net core 3.1. I later specialized Quguan network search of the investigation, we found the official documentation, it can be used net core 3.1on, then I repeated tests, and finally the successful commissioning, recording what I hope it can help someone else stepped pit.



Solution:

Let's just talk about the solution: replace the version of your previous library with the following;
Insert picture description here

This will work. I don’t know why. Note that the key is to sqlServerreduce the version of the package to version 3.1. Logically speaking, the two nuget packages should still not affect each other, but you only need to upgrade. As of version 5.0, it has problems, and I know why.

Guess you like

Origin blog.csdn.net/zhaozhao236/article/details/111426550