Problems with the .NET Framework Data Provider.

I am new to ASP.NET. Every time I try to run my application, I come across an error message below. I have already installed the .Net Framework Data Provider for MySQL several times. Hope someone can help me with this. Thanks in advance.

Server Error in '/PLDT QuickSearcher' Application. Unable to find the requested .Net Framework Data Provider. It may not be installed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed. 
+4
source share
3 answers

Add MySql.Data.dll as a reference to the project
Add this block to the web.config file:

 <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" /> </DbProviderFactories> </system.data> 
+13
source

Link to packages MySql.Data and MySql.Entities Nuget. Then add this line to your web 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=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data> 

The connection string should look like the following:

 <add name="MyDb" connectionString="Server=127.0.0.1;Port=3306;Database=MyDb;Uid=root;Pwd=;" providerName="MySql.Data.MySqlClient" /> 
+9
source

I solved this problem with the following 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" /> </DbProviderFactories> </system.data> <entityFramework> <providers> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /> </providers> </entityFramework> 
+1
source

Source: https://habr.com/ru/post/1380354/


All Articles