After the ASP. NET Core 1.1 upgrade, the solution to MySQL error is to operate.

Source: Internet
Author: User

Encounter problems

Core version upgrade from 1.0 to 1.1, Operation MySQL database, query data encountered missingmethodexception problem, UPDATE, insert operation no problem.

If you are experiencing this problem, please refer to the following steps for the upgrade operation.

Operation Steps and Contents

    • If your project has already cited the following sections, upgrade the content in turn:
Pm> update-Packagemicrosoft.entityframeworkcorepm> update-Package Microsoft.EntityFrameworkCore.SqlServerPM> update-PackageMicrosoft.EntityFrameworkCore.RelationalPM > Update-package microsoft.entityframeworkcore.tools-pre
    • If you have not installed it, please use the installation statement
Pm> install-Packagemicrosoft.entityframeworkcorepm> install-Package Microsoft.EntityFrameworkCore.SqlServerPM> install-Package Microsoft.EntityFrameworkCore.RelationalPM> Install-package microsoft.entityframeworkcore.tools-pre
    • After the installation is complete, if you reference 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 the IDE you are using is vs Code, add the dependencies below in the Project.json
" SAPIENTGUARDIAN.ENTITYFRAMEWORKCORE.MYSQL " " 7.1.14 "
    • Then execute the dotnet restore in the CLI
    • Then you need to add the reference content to the Startup.cs.
using MySQL.Data.Entity.Extensions;

Well, the rest of the code doesn't change much. Try again and you will find that your system is working properly.

Reference documents

1.announcing Entity Framework Core 1.1 Rowan Miller

After the ASP. NET Core 1.1 upgrade, the solution to MySQL error is to operate.

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.