If the problem is reported incorrectly, the screenshot is as above, and the solution is as follows
Step 1: find MySQL in [reference] Version number in data
The second step is on the web Add the following configuration to config
<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.24.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
Note that the version of the above configuration information needs to be changed to the mysql. XML you just viewed Data version number
Then switch to release, regenerate the solution, regenerate the project, and republish.
However, it is strange that I need to delete this configuration information when running locally; This configuration information needs to be added when the server is running
I don’t know why.