How to handle mysql errors after asp.net core 1.1 is upgraded ., Coremysql

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.