Bug #77638 Missing instructions on how to setup a project to use MySQL
Submitted: 7 Jul 2015 12:32 Modified: 19 Apr 2017 18:48
Reporter: Luca Cavagnoli Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Documentation Severity:S3 (Non-critical)
Version: OS:Windows (Visual Studio 2013)
Assigned to: Christine Cole CPU Architecture:Any

[7 Jul 2015 12:32] Luca Cavagnoli
Description:
The documentation at the following url:

http://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

fails to mention that, in order to use the MySQL Connector .NET, the following section needs to be added to App.config / Web.config:

<system.data>
  <DbProviderFactories>
    <remove invariant="MySql.Data.MySqlClient" />
    <add invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" description=".Net Framework Data Provider for MySQL" name="MySQL Data Provider" />
  </DbProviderFactories>
</system.data>

As a matter of fact, this section is added automatically when installing the MySQL Connector .NET packages with Nuget.

Doing so is also more effective and less obstrusive than setting the new DbConfiguration class for MySql; and it also allows one to use both SQL Server and MySQL in the same App Domain.

How to repeat:
Do not add the config section and do not set the the new DbConfiguration class for MySql.

Runtime errors will ensue.

Suggested fix:
Add directions to add the following section in a poject's .config file:

<system.data>
  <DbProviderFactories>
    <remove invariant="MySql.Data.MySqlClient" />
    <add invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" description=".Net Framework Data Provider for MySQL" name="MySQL Data Provider" />
  </DbProviderFactories>
</system.data>
[7 Jul 2015 13:26] Chiranjeevi Battula
Hello Luca Cavagnoli,

Thank you for the bug report.

Thanks,
Chiranjeevi.
[19 Apr 2017 18:48] Christine Cole
Posted by developer:
 
The procedure has been updated as suggested, see 
https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html.

Thank you for the bug report.