简体   繁体   中英

How to use MySQL for .NET Core Azure functions

I am attempting to write an Azure function and use MySQL but I cannot seem to use the MySQL.Data or MySql.Data.MySqlClient directives. The error I am getting is the following:

The type or namespace name 'MySql' could not be found.

I am not sure what I need to make this work

using MySql.Data; 
using MySql.Data.MySqlClient;

This seems to be either Nuget/Project type issue. Try the following,

  1. use NuGet to download the latest version. Just right click on the project and click 'Manage NuGet Packages' then search online for MySql.Data and install.

Check the project or create a new project

  1. To change your project's framework right-click on your project select Properties -> Application -> Target framework.

我使用的是内置的浏览器天蓝色函数创建器,这似乎有很多局限性,我建议您使用其他方法,直到对内置的天蓝色函数创建器进行改进为止

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM