使用mysql8.0.29后,程序报下面异常:
mysql8 Unable to find the requested .Net Framework Data Provider. It may not be installed.
使用更新config文件方案解决:
在configuration下增加以下内容后正常访问数据库:
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"/>
<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.29, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
</configuration>