How to handle mysql errors after asp.net core 1.1 is upgraded ., Coremysql
Problem Encountered
The core version is upgraded from 1.0 to 1.1 to operate the mysql database. When querying data, the system encounters the MissingMethodException problem. The update and insert operations are correct.
If you have encountered this problem, follow these steps to upgrade the instance.
Procedure and content
- If your project has referenced the following content, please upgrade the content in sequence:
PM> Update-Package Microsoft.EntityFrameworkCorePM> Update-Package Microsoft.EntityFrameworkCore.SqlServerPM> Update-Package Microsoft.EntityFrameworkCore.RelationalPM> Update-Package Microsoft.EntityFrameworkCore.Tools -Pre
- If you have not installed it, use the installation statement.
PM> Install-Package Microsoft.EntityFrameworkCorePM> Install-Package Microsoft.EntityFrameworkCore.SqlServerPM> Install-Package Microsoft.EntityFrameworkCore.RelationalPM> Install-Package Microsoft.EntityFrameworkCore.Tools -Pre
- After the installation is complete, if the mysql extension you reference is of the following version (or earlier than this version .) Still unable to complete the query operation.
"MySql.Data.EntityFrameworkCore": "7.0.6-IR31"
- Remove this reference and use NUGET to install SapientGuardian. EntityFrameworkCore. MySql
PM> Install-Package SapientGuardian.EntityFrameworkCore.MySql
- If the IDE you are using is vs Code, add the following dependency to project. json.
"SapientGuardian.EntityFrameworkCore.MySql": "7.1.14"
- Then execute dotnet restore in CLI
- Then you need to add reference content in startup. cs.
using MySQL.Data.Entity.Extensions;
All right, other code remains unchanged. Try again and you will find that your system is working properly.
References
1. Announcing Entity Framework Core 1.1 Rowan Miller