Asp. net Core 1.1 Solution to Error Operating mysql after Upgrade

  • 2021-09-04 23:57:13
  • OfStack

Encounter problems

The version of core was upgraded from 1.0 to 1.1. When operating mysql database and querying data, MissingMethodException problems were encountered, and there was no problem in updating and inserting operations.

If you also encounter this problem, please refer to the following steps for upgrading.

Operation steps and contents

If your project has already referenced the following parts, please upgrade the contents in turn:


PM> Update-Package Microsoft.EntityFrameworkCore
PM> Update-Package Microsoft.EntityFrameworkCore.SqlServer
PM> Update-Package Microsoft.EntityFrameworkCore.Relational
PM> Update-Package Microsoft.EntityFrameworkCore.Tools -Pre

If you have not installed it, please use the installation statement


PM> Install-Package Microsoft.EntityFrameworkCore
PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer
PM> Install-Package Microsoft.EntityFrameworkCore.Relational
PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Pre

After installation, if the mysql extension you refer to is the following version (or less.) The query operation will still not be completed.


 "MySql.Data.EntityFrameworkCore": "7.0.6-IR31"

Remove the reference and install SapientGuardian. EntityFrameworkCore. MySql using NUGET


PM> Install-Package SapientGuardian.EntityFrameworkCore.MySql

If your IDE is vs Code, add the following dependencies to project. json


"SapientGuardian.EntityFrameworkCore.MySql": "7.1.14"

Then execute dotnet restore in CLI

Then you need to add references to startup. cs.


using MySQL.Data.Entity.Extensions;

Well, the rest of the code hasn't changed much. Try again and you will find that your system can work normally. If you have any questions, please leave me a message, and this site will reply to you in time. Thank you very much for your support to this site!


Related articles: