Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I keep getting this error in my asp.net webapi:
error 0175: The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file, or could not be loaded. 

I do not have any refeences to mysql in my application.

What I have tried:

the connection string:
<add name="DefaultConnection" connectionString="Server=tcp:999.99.999.99;
        Initial Catalog=zbulkdb;Persist Security Info=False;User ID=xxxx;Password=xxxxxxxxxx;
        MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;
        Connection Timeout=30;TrustServerCertificate=True" providerName="System.Data.SqlClient" />


Providers:
<providers>
<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer">
Posted
Updated 3-Jul-20 0:51am

1 solution

You most likely have a MySQL connection string defined in a higher level config file - either a parent application, or in the machine-wide config.

Try clearing the connection strings before adding your own:
XML
<connectionStrings>
    <clear />
    <add name="DefaultConnection" connectionString="..." providerName="System.Data.SqlClient" />
</connectionStrings>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900