asp.net Core 1.1 After upgrade operation MySQL error how to solve

Source: Internet
Author: User
Tags mysql database

Encounter problems

Core version from 1.0 to 1.1, operating the MySQL database, query data encountered missingmethodexception problems, UPDATE, insert operation no problem.

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

Operation Steps and Contents

If your project has already referenced the following sections, upgrade the content in sequence:

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 yet installed, 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 the installation is complete, if you refer to the MySQL extension is the following version (or less than that version.) will still be unable to complete the query operation.

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

Remove the reference and use NuGet to install the SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL

Pm> Install-package SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL

If you use the IDE as vs Code, add the bottom dependencies in the Project.json

"SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL": "7.1.14"

Then execute dotnet restore in the CLI

Then you need to add the reference content to the Startup.cs.

Using MySQL.Data.Entity.Extensions;

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.