Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Config Example #25

@jrocha

Description

@jrocha

I guess it would be nice to point it out somewhere that DbProviderFactoriesConfigurationHandler is not supported by .NET Core itself and is right now handled by EnterpriseLibrary.

Below is an example of a config file using another provider than default ones.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, Microsoft.Practices.EnterpriseLibrary.Data"/>
  </configSections>


  <connectionStrings>
    <add name="TestMariaDbConnectionString" connectionString="Server=localhost;User ID=root;Password=password;Database=TestDb" providerName="MySqlConnector"/>
  </connectionStrings>

  <system.data>
    <DbProviderFactories>
      <remove invariant="MySqlConnector" />
      <add name="MySqlConnector" invariant="MySqlConnector" description="Async MySQL ADO.NET Connector" type="MySql.Data.MySqlClient.MySqlClientFactory, MySqlConnector" />
    </DbProviderFactories>
  </system.data>
  
</configuration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions